# R and the Tidyverse

> An alternative analysis language with first-class statistics and the tidyverse for readable data pipelines. Free notes, key concepts, resources and a mini...

Canonical: https://www.internhack.in/roadmaps/tracks/data-analyst/r-for-analysis
Last updated: 2026-11-28

An alternative analysis language with first-class statistics and the tidyverse for readable data pipelines.

Beginner · about 15 hours · difficulty 2/5

R was built by statisticians for data analysis. It is common in academia, healthcare, pharma, public policy and some finance teams. If your target employers use R, it is an equally valid first language; otherwise Python has the broader job market.

### Why people love R

- **Tidyverse**: a consistent set of packages. `dplyr` for manipulation (`filter`, `select`, `mutate`, `group_by`, `summarise`), `tidyr` for reshaping, `readr` for import, `ggplot2` for graphics.
- **The pipe** (`|>` or `%>%`) chains steps into readable pipelines.
- **ggplot2** is one of the best static plotting systems in any language, based on the grammar of graphics.
- **Statistics built in**: `lm`, `glm`, `t.test` and thousands of CRAN packages for specialised methods.
- **Quarto / R Markdown**: combine code, output and prose into reports and slides.

### Getting started

Install R and the RStudio (Posit) IDE, then `install.packages("tidyverse")`. Work through the free book R for Data Science.

### Choosing

Pick one language and go deep before learning the other. Concepts (tidy data, grouping, joins, plotting grammar) transfer directly, so switching later is not wasted effort.

**Pitfall:** mixing base R and tidyverse styles randomly while learning. Stick to tidyverse at first. Move on when you can import, clean, summarise and plot a dataset with a single readable pipeline.

## Key concepts

- **R and RStudio setup**
- **Vectors and data frames**
- **dplyr verbs**
- **tidyr reshaping**
- **ggplot2**
- **Pipes**
- **Quarto and R Markdown reports**

## Other options for this step

- [Python for Analysts](https://www.internhack.in/roadmaps/tracks/data-analyst/python-for-analysis): The Python you actually need for analysis: types, collections, control flow, functions, files and packages.

## Mini project

Using the palmerpenguins dataset in R, produce a Quarto report that summarises body mass by species and sex and includes two ggplot2 charts.

## Check yourself

What does group_by followed by summarise produce, and how is it similar to SQL GROUP BY?

## Free resources

- [R for Data Science (2e)](https://r4ds.hadley.nz/) (Hadley Wickham et al.)
- [Tidyverse](https://www.tidyverse.org/) (Posit)
- [Quarto](https://quarto.org/) (Posit)

Previous: [Python for Analysts](https://www.internhack.in/roadmaps/tracks/data-analyst/python-for-analysis) · Next: [Jupyter Notebooks and Reproducible Work](https://www.internhack.in/roadmaps/tracks/data-analyst/jupyter-notebooks)

## More in Programming for Analysis

- [Python for Analysts](https://www.internhack.in/roadmaps/tracks/data-analyst/python-for-analysis)
- [R and the Tidyverse](https://www.internhack.in/roadmaps/tracks/data-analyst/r-for-analysis)
- [Jupyter Notebooks and Reproducible Work](https://www.internhack.in/roadmaps/tracks/data-analyst/jupyter-notebooks)
- [NumPy Essentials](https://www.internhack.in/roadmaps/tracks/data-analyst/numpy-basics)
- [pandas for Data Analysis](https://www.internhack.in/roadmaps/tracks/data-analyst/pandas-core)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Data Analyst Roadmap](https://www.internhack.in/roadmaps/tracks/data-analyst)
