Why learn R?
Built by statisticians, for statistics — and still hard to beat for it
R was created specifically for statistical computing and graphics, which shows in how naturally it handles vectors, data frames, and formulas compared to general-purpose languages. It remains dominant in academia, biostatistics, epidemiology, and any field where rigorous statistical modeling is the actual deliverable.
The tidyverse — a collection of packages including dplyr, tidyr, and ggplot2 — transformed R's ergonomics over the last decade, giving it a consistent, readable syntax for data wrangling and some of the best data visualization tooling of any language.
R and Python overlap heavily in data science today; R tends to pull ahead for statistical rigor, exploratory analysis, and polished visualizations, while Python leans toward production deployment and general-purpose engineering.
The R Roadmap
Work through these in order, from syntax to a shareable analysis
R Basics
Get R and RStudio installed and get comfortable with the console before anything else.
Data Types & Structures
Everything in R is a vector — the sooner that clicks, the sooner the rest makes sense.
Operators & Control Structures
Compare values, branch, and loop — the same fundamentals as any language, in R's syntax.
Functions
Write reusable logic, and understand how R actually passes arguments.
Data Import & Wrangling
Get real data in, then clean, reshape, and combine it before any analysis happens.
Data Visualization
Turn a data frame into a plot that actually communicates something.
Statistical Analysis
The core statistical toolkit R was built to make effortless.
Modeling
Move from describing data to predicting or explaining it.
Reporting & Reproducibility
Turn an analysis into something you can share, rerun, and trust.
Packages & Ecosystem
Manage dependencies reliably, and know where to look when you need a package.
GitHub Projects
Real, buildable projects to put on your own GitHub
Tidyverse Source
Browse the dplyr and tidyr source to see how idiomatic, pipe-friendly data wrangling functions are actually built.
TidyTuesday
Join a weekly community project with a fresh real-world dataset each week — great practice for wrangling and ggplot2 visualization.
Build a Shiny Dashboard
Fork an official Shiny example and extend it into your own interactive dashboard over a dataset you care about.
Write Your Own R Package
Use usethis and devtools to scaffold, document, and test a small R package around functions you've already written.
Frequently Asked Questions
Common questions from people starting out with R
Should I learn R or Python for data science?
Both are strong choices and many data scientists use both. R tends to have an edge for statistical rigor, exploratory analysis, and polished visualization; Python is generally stronger for production deployment, general-purpose scripting, and deep learning. Academic and biostatistics-heavy fields lean more on R.
What's the difference between R and RStudio?
R is the programming language and runtime itself. RStudio (now Posit) is an IDE built specifically around R — it adds a console, script editor, plot viewer, and package management in one interface, and is close to the default way people actually write R.
What is the tidyverse, and do I need it?
The tidyverse is a collection of R packages — including dplyr, tidyr, and ggplot2 — designed to work together around a consistent, readable syntax for data manipulation and visualization. It's not required, but it's become the de facto standard for modern R code and is worth learning early.
Is R good for machine learning?
Yes, particularly for classical statistical models and packages like caret and tidymodels. For deep learning specifically, Python's ecosystem (PyTorch, TensorFlow) is more mature, though R does have interfaces to both.
What's the difference between %>% and |>?
%>% is the magrittr pipe popularized by the tidyverse; |> is the native pipe built into R itself since version 4.1. Both pass the result of one expression as the first argument to the next, and code today commonly uses either depending on the project's R version and style.
How do I share an R analysis with someone who doesn't use R?
R Markdown or Quarto let you "knit" code, output, and narrative text into a shareable HTML, PDF, or Word document, while Shiny turns an analysis into an interactive web app that runs in any browser.
Track complete
From vectors and the tidyverse to ggplot2, statistical tests, and modeling — that's the core of what's expected of anyone doing serious data analysis in R. Keep building, and share what you find with R Markdown or Shiny.
Where next?
Keep exploring by domain or drill into a single skill