Amounts and proportions

Due by 11:59 PM on Monday, September 22, 2025

For this exercise you’ll practice grouping, summarizing, and plotting counts and proportions using data on animals admitted to shelters run by the City of Long Beach Animal Care Services—this is real government data!

There are 22 columns, and they’re documented here—make sure you consult that page!

And as always, if you’re struggling, please use Discord and talk to me and your classmates! Don’t suffer in silence!

ImportantCheck the example!

The example page for this week will be helpful!

Instructions

  1. Open the project either on your computer or in Posit.cloud

    • 04-exercise.zip: If you’re using R on your own computer, download this file, unzip it, and double click on the file named 04-exercise.Rproj
    • Posit.cloud project: Use this link if you’re using Posit.cloud in your browser
  2. Rename the Quarto file named your-name_exercise-4.qmd to something that matches your name and open it in RStudio.

  3. Complete the tasks given in the Quarto file. You can definitely copy, paste, and adapt from other code in the document or the example page—don’t try to write everything from scratch!

  4. When you’re all done, click on the “Render” button at the top of the editing window and create a Typst (pdf), PDF, or Word version of your document. Upload that file to iCollege. Do not upload a rendered HTML file (they don’t work on iCollege).

Tips

TipRunning chunks

Remember that you can run an entire chunk by clicking on the green play arrow in the top right corner of the chunk. You can also run lines of code line-by-line if you place your cursor on some R code and press + enter (for macOS users) or ctrl + enter (for Windows users).

Make sure you run each chunk sequentially. If you run a chunk in the middle of the document without running previous ones, it might not work, since previous chunks might do things that later chunks depend on.

TipInserting chunks

You’ll need to insert some of your own code chunks. Rather than typing them by hand (that’s tedious!), use the “Insert” button at the top of the editing window, or press + + I on macOS, or ctrl + alt + I on Windows.