R Practice Labs
Real R. In your browser. Powered by WebR.
10 hands on labs for students who’ve completed Introduction to Statistics. Write R code, click Run, see results: right in your browser. No RStudio required.
Progress is saved in your browser. No account needed.
Powered by WebR: R runs right here
No accounts. No downloads. No RStudio. No cloud IDE. R runs directly in your browser using WebR, a full R runtime compiled to WebAssembly. All packages, all output, all plots: everything stays right here on this page.
Before You Start
These labs are designed for students with basic R familiarity: ideally after completing Introduction to Statistics. You should know what a variable is, how to call a function, and have seen a vector before. If you’re brand new to R, start with a beginner tutorial first.
Foundations: Labs 1 to 3
Vectors & Data Types
Practice creating and manipulating numeric, character, logical, and factor vectors. Master indexing, vectorized operations, and logical subsetting.
Open Lab →Data Frames
Create, explore, filter, and sort data frames. Access columns with $, subset rows with conditions, add new columns, and produce summary statistics.
Open Lab →dplyr: Data Wrangling
Master filter(), select(), mutate(), arrange(), group_by(), and summarize(). Chain operations with the pipe |> for clean, readable analysis.
Open Lab →Functions & Control Flow
Write your own R functions, use if/else, for loops, and the apply family. Build a complete statistics toolkit of reusable functions.
Open Lab →String Manipulation
Use base R string functions and the stringr package to clean messy data, detect patterns with regex, and extract structured info from text.
Open Lab →ggplot2: Data Visualization
Build publication quality charts with ggplot2. Bar charts, scatter plots, histograms, boxplots, and faceted figures. Plots render right in the browser.
Open Lab →Statistical Analysis
Run t tests, correlations, and linear regression. Interpret coefficients, p values, and R². Simulate data and test statistical hypotheses.
Open Lab →Tidyr & Data Import
Transform wide data to long and back with pivot_longer() and pivot_wider(). Use separate() and unite(). Learn what “tidy data” really means.
Open Lab →R Markdown Style Reports
Build formatted, professional looking reports using cat(), sprintf(), and structured output functions. Write code that tells a story.
Open Lab →Capstone: Full R Analysis
You’re a university analyst. Analyze student outcomes data end to end: descriptive stats, visualizations, hypothesis tests, regression, and a written executive summary.
Open Lab →How Each Lab Works
Every lab follows the same 5 part structure so you always know what to expect.
Concept Recap
A quick review of the key R concepts you’ll practice, no new theory, just a crisp reminder.
Worked Example
A complete code example showing the concepts in action: study it before writing your own.
Guided Exercise
Starter code with blanks to fill in. Lower stakes, lots of hints to get you going.
Independent + Challenge
Two exercises where you write more on your own. The challenge pushes further.
Mini Project
A complete real world R task that ties the whole lab together.
Technical notes
- All labs load WebR, which compiles R to WebAssembly: allow 15 to 20 seconds on first load.
- Labs 1 to 5 and 7 to 9 use text output. Lab 6 renders ggplot2 charts directly on the page.
- Everything runs locally in your browser tab. Nothing is sent to a server.
- Works best in Chrome or Firefox. Safari should work too.
- Your code is NOT saved between page refreshes. Copy anything you want to keep.