Quiz
You have finished the workflow section: organizing work with RStudio Projects and here, pinning packages with renv, tracking changes with git, the modern 2026 toolchain, and a reproducible analysis from start to finish. This short quiz checks what stuck. Pick an answer to continue; you can retry until it clicks. The last two steps are live R, run them and tinker.
Paths that do not break
Why prefer here("data", "sales.csv") over a hard-coded path like "C:/Users/me/project/data/sales.csv"?
What renv pins
What problem does renv solve?
renv snapshots versions into a lockfile, so the project keeps working even as packages change over time.renv and git solve different problems and are used together.What git tracks
What does git give you in a project?
Why a project, not setwd
What is the main benefit of working inside an RStudio Project rather than calling setwd()?
here() and shared code just work.setwd() step entirely.Data bigger than memory
Your dataset is too large to fit comfortably in R's memory. Which modern tool is built to query it without loading it all in?
Making randomness repeatable
Your analysis uses random sampling, and you need the exact same result every time you run it. What makes that happen?
set.seed in live R
Fix the seed, then draw five random numbers. Run it twice and notice you get the same five numbers, then change 42 to another number and watch them change.
A fixed seed makes the random draw repeatable, the foundation of an analysis anyone can reproduce exactly.
A small pipeline in live R
Run a self-contained analysis: average miles-per-gallon by cylinder count, from a built-in dataset. Run it, then change mean to max.
Because it uses a built-in dataset and no external state, this analysis gives the same answer for anyone who runs it, which is the whole point of a reproducible workflow.
Section complete
Excellent. You can keep paths portable with here(), pin versions with renv, track history with git, explain why a Project beats setwd(), reach for duckdb or arrow on big data, and make an analysis repeatable with set.seed(). That completes the New to R foundations: you now have a solid, reproducible command of base R and the modern toolchain.