2026-01-29
Use a phrase you might type for a google search, or turn your phrase in to a question:
Write a journal to learn:
Explain what %>% does in the code co2_1960 <- co2_raw %>% filter(year >= 1960)
What is the difference between =, ==, and <- ?
Explain and improve diamonds |> ggplot(aes(x = price, y = carat)) + geom_bin2d() + scale_x_log10() (Example from Lesson 8.)
From last class: Explain the following code line by line
diamonds |>
mutate(price_per_carat = price / carat) |>
group_by(color, clarity, cut) |>
summarise(median_price_per_carat = median(price_per_carat),
n = n(),
.groups = "drop") |>
arrange(-median_price_per_carat) |>
group_by(cut) |>
slice_head(n=2) |>
arrange(-median_price_per_carat)
Ask the LLM to challenge you or give you some examples: Give me some interesting calculations to make summary tables with group_by, mutate and summarize.
Help me improve the following code to make a scatter plot: mpg |> ggplot() + geom_point(aes(displ, cty))
I’d like to reproduce Hans Rosling’s life expectancy vs GDP figure, without animation using the tidyverse. I want to learn how to make the figure, so don’t give me the code or an answer. Instead ask me questions to help me figure out what I need to know to solve this challenge.
I can get as far as: gapminder |> ggplot() + geom_point(aes(gdpPerCapita, lifeExp)). Can you help me with the size of the dots?
Keep going until you are happy with the result …
Write in your journal
Help me find and summarize temperature data from Halifax, NS using R and the tidyverse.
Write tidyverse code to compute the distribution of the number of days in a row with a daily high temperature below freezing in Halifax
str() or head() so the AI understands your variables.Danger
If you copy-paste without understanding, you haven’t learned.
The Solution: Read-Understand-Revise
You will need to demonstrate your knowledge of course material on a written test without computer assistance, so be sure you check your understanding