Skip to content
Real R · dplyr · ggplot2

R Practice

Real R runs in your browser via WebR. dplyr and ggplot2 are pre-loaded. Three Kenyan datasets are pre-defined as data frames so you can practice the tidyverse workflow on real data from the moment you start.

Difficulty up to
0/43 done · 0%

Why R is vector-first by default, the assignment arrow, and how to read R's function help pages.

R is vectorised by default. c(1, 2, 3) * 2 gives c(2, 4, 6) element-wise. There is no scalar-vs-array distinction; even a single number is a length-1 vector.

Assignment uses the arrow operator: x <- 5. The equals sign also works but is convention-frowned-upon outside function calls. The arrow goes both ways: 5 -> x is valid but rare.

Help: ?mean opens the help page for mean. ??regression does a fuzzy search across all installed packages. The Examples section at the bottom of every help page is usually the fastest way to learn how a function is used.

Chapter 1 · Exercise 1Easy

Hello, world

Print the string Hello, Kenya.

analysis.Rdplyr · bankrates, pension, mpesa pre-loaded

Powered by WebR — R compiled to WebAssembly. All execution happens in your browser.