Practice, test 💪

If you don’t practice, you won’t learn anything

webr
test
Every session’s practice section in one index, plus a taste of in-browser R: no installation needed, thanks to the quarto-live extension.
Author

Nelson Amaya

Published

July 31, 2022

Modified

July 20, 2026

Run the code

The windows below run R inside your browser –nothing to install, thanks to WebAssembly and the quarto-live extension. Edit the code, press Run Code, break things, fix them.

Below you can find a familiar exercise from the Plots session:

Your turn

Complete the code to count how many diamonds there are for each cut, from most to least common. If you get stuck, check the hint –and only then the solution.

NoteHint

count() takes the variable you want to tally. arrange(desc(n)) sorts the tally from largest to smallest.

TipSolution
library(dplyr)

diamonds |>
  count(cut) |>
  arrange(desc(n))

Every practice, in one place

Exercises like the one above now live at the end of their own session, next to the material they test. Sessions marked ▶ in-browser run their Basic and Intermediate exercises right on the page, just like this one.

Build with R

Work with AI

Think with data

Back to top