Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Summarization] updating lab_Dec2024 #253

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions modules/Data_Summarization/lab/Data_Summarization_Lab_Key.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ces %>% pull(TotalPop) %>% sum()

### 1.3

What was the largest population, according to the 2010 census, for a single census tract (row)? Use `summarize` and `max`.
What was the largest population, according to the 2010 census? Use `summarize` and `max`.

```
# General format
Expand All @@ -60,7 +60,7 @@ ces %>%

### 1.4

Modify your code from 1.3 to add the smallest population among census tracts. Use `min` in your `summarize` function.
Modify your code from 1.3 to add the smallest population among census tracts. Use `min` in your `summarize` function. *HINT:* Make sure you make your `SUMMARY_COLUMN_NAME` different for the max and the min summaries! What do you think would happen if you tried to make `SUMMARY_COLUMN_NAME` the same name for both statistics?

```
# General format
Expand All @@ -74,6 +74,13 @@ DATA_TIBBLE %>%
ces %>%
summarize(max = max(TotalPop),
min = min(TotalPop))

#If your code uses the same name for both summary columns, the output only has one column.
test <- ces %>%
summarize(summary = max(TotalPop),
summary = min(TotalPop))

test
```


Expand Down
Loading