HW 3: dplyr Review (Koans 4–6)

Enter your name, answer the questions, then click Grade and Download PDF.

Short answers are auto-checked flexibly. Your instructor may review.

Multiple Choice (15)
1) What does filter() do?
2) Which operator means “not equal to” in R?
3) What does %in% help you do inside filter()?
4) Which line keeps only the columns country, year, and lifeExp?
gapminder %>%
  ___(country, year, lifeExp)
5) What does mutate() do?
6) What does this code do?
gapminder %>%
  arrange(desc(pop))
7) What does slice(2:4) do?
8) Without group_by(), summarize() usually returns
9) What does group_by(continent) mainly change?
10) Which pipeline correctly computes the median life expectancy for each year?
11) What does slice_head(n = 5) do?
12) What does count(country) return?
13) In filter(), separating conditions with a comma means
14) What does filter(year >= 2000) keep?
15) Which verb primarily reduces rows?
Short Answer (5)
SA1) In one sentence, explain what filter() does.
SA2) What is the difference between select() and filter()?
SA3) Why is group_by() usually paired with summarize()?
SA4) What does mutate() do that summarize() does not?
SA5) Explain the difference between arrange() and slice().

PDF note: This generates a PDF in your browser using jsPDF. If a school device blocks CDNs, you may need to download jsPDF and host it locally.