R Programming Roadmap
This R Programming Roadmap is a free, full-text syllabus of 129 lessons in 23 stages, starting with Introduction and ending with Big Data Tools. It suits anyone who wants to learn R Programming, whether new to it or filling gaps. There is no fixed length: every lesson is open from the start, so you go at your own pace and skip what you already know.
Last updated
Reading is open to everyone. Sign in to join this roadmap and track what you finish.
Continue learning
1. IntroductionIntroduction
0%Introduction
8 topics · 3 sub-topics · 0 completed
The last 4 topics are drawn beside this stage on the original roadmap. Which stage they belong to is not recorded, so they are listed here rather than filed under one.
The diagram draws the same 129 lessons as a map, with lines showing the order. It needs JavaScript; the full syllabus below lists every lesson as text.
Full syllabus: every lesson in the R Programming roadmap
23 stages and 129 lessons, in the order the roadmap suggests. Every lesson is free to read and open from the start.
Stage 1: Introduction
Introduction
R is a programming language built for statistical computing and data analysis. Bell Labs statisticians created its predecessor, S, in the 1970s, and R emerged in the 1990s as an open-source implementation of similar ideas. It comes with built-in support for vectors, data frames, and statistical functions, so tasks…
R vs Python
R and Python solve overlapping problems but come from different roots. R grew out of statistics departments, so its core language and packages treat data frames, vectors, and statistical models as first-class citizens. Python grew as a general-purpose language, so its data tools (pandas, NumPy) were added on top of…
Installing R
Installing R involves downloading the base software environment from the Comprehensive R Archive Network (CRAN) and executing the installer for your specific operating system. This process sets up the core language engine, allowing you to run R scripts, manage packages, and perform statistical computations directly…
Your First R Script
A first R script is usually a short file with a few lines of code, like assigning a variable and printing it, run to confirm your R installation actually works. Writing and running this first script is where syntax stops being abstract and starts being something you can see execute. It's also the point where you…
Installing Packages
Installing packages adds functionality to R beyond what comes built in, using the base function install.packages() to download and install from CRAN. Running install.packages("dplyr"), for example, fetches the dplyr package and its dependencies. This is the most basic and common way to extend R with new capabilities.
CRAN
CRAN, the Comprehensive R Archive Network, is R's official package repository, hosting tens of thousands of vetted packages. Packages published on CRAN go through basic automated checks before release, giving them a baseline level of reliability. It's the default source install.packages() pulls from, and most…
renv
renv manages package versions on a per-project basis instead of one shared library for your whole machine. It records the exact package versions a project uses in a lockfile, so anyone who opens that project later can restore the exact same environment. This solves the common problem where a script that worked…
pak
pak is a newer package installer for R designed to replace install.packages() with something faster and more reliable. It parallelizes downloads, caches packages locally so reinstalls are quicker, and gives clearer error messages when a dependency conflict occurs. Many R developers now use it as their default…
Stage 2: Setting Up
Setting Up
This section covers configuring your R environment: managing packages, choosing an IDE, and setting up tools for publishing your work. It's the practical groundwork that makes the rest of your R workflow smooth.
Stage 3: Basic Syntax
Basic Syntax
This section covers the fundamental building blocks of writing R code: variables, operators, comments, and basic control structures. It's the vocabulary you need before anything more complex makes sense.
Creating Variables
Creating a variable stores a value under a name so you can reuse it later, most commonly using the <- assignment operator, though = also works in most contexts. Once assigned, a variable holds its value until you reassign or remove it. This is one of the very first things you do in any R script.
Operators
Arithmetic operators handle basic math, like +, -, , and /. Relational operators compare values and return a logical result, like == and <. Logical operators combine or invert logical values, using & and | for element-wise comparisons. These form the backbone of nearly every calculation and condition you write in R.
Pipe
The pipe operator takes the result on its left and passes it as the first argument to the function on its right, letting you chain several operations in a readable, top-to-bottom sequence. R now has two common versions: the native pipe |, built into base R since version 4.1, and the older magrittr pipe %%, which…
Comments
Comments start with and are ignored when R runs the code, letting you leave notes explaining what a piece of code does or why. They don't affect how a script executes, but they make code easier to understand later, whether for someone else or for yourself after time has passed. Good commenting habits pay off…
Conditional Statements
Conditional statements let code branch based on whether something is true or false, using if, else if, and else. R evaluates the condition, runs the matching block, and skips the rest. R also offers ifelse() and dplyr's casewhen() for applying conditional logic across an entire column of data at once.
Loops
A for loop repeats a block of code once for each element in a vector or list. A while loop repeats as long as a condition stays true, useful when you don't know in advance how many iterations you'll need. R loops are generally slower than vectorized alternatives, so experienced R users often reach for functions…
RStudio
RStudio is the most established integrated development environment for R, combining a script editor, console, plot viewer, and package tools in one window. It has deep, mature support for building R packages and rendering Quarto or R Markdown documents. Posit develops and maintains it, and much existing R…
Positron
Positron is a newer IDE from Posit, built on the same underlying technology as VS Code but tailored for data science work in R and Python. It combines a modern, extensible editor with the data-focused features R users expect, like a variables pane and integrated plots. It's becoming the default recommendation for…
VS Code
VS Code is a general-purpose code editor from Microsoft that supports R through extensions rather than built-in features. It fits projects where R is just one part of a larger codebase involving other languages, since it shares one consistent editor across all of them. R support in VS Code is solid but less…
Stage 4: Data Types
Data Types
This section covers the basic kinds of values R works with: numbers, text, and logical values. Every piece of data in R falls into one of these categories, and knowing them shapes how you write and debug code.
Numeric
Numeric is R's default type for numbers with decimal points, such as 3.14 or 2.0, stored internally as double-precision floating point values. Almost all arithmetic in R produces numeric results unless you explicitly ask for integers. This is the type used for the vast majority of everyday calculations.
Integer
Integers are whole numbers stored more compactly than numeric values, created by appending an L to a number, like 5L. They matter when memory efficiency counts, since integers take up less space than numeric doubles. Most everyday R code doesn't need to worry about the distinction, since R converts between the two…
Character
Character is R's type for text, written inside single or double quotes, like "hello". R provides many built-in and package functions for searching, splitting, and reformatting text stored this way. Character data shows up constantly in real datasets: names, categories, free-text responses, file paths.
Logical
Logical values represent true or false, written as TRUE and FALSE. They result from comparisons like 5 3 and drive conditional logic throughout R code, such as if statements and filtering rows in a data frame. Logical values can also be summed directly, since R treats TRUE as 1 and FALSE as 0 in numeric contexts.
Complex
Complex numbers combine a real and imaginary part, written in R as something like 3+2i. They come up in specialized mathematical work, such as signal processing, but most day-to-day data analysis never touches them directly. R supports them fully as a native type, including arithmetic and functions like Mod() and…
Quarto
Quarto is a publishing system that renders documents combining text, code, and code output into formats like HTML, PDF, or Word. It works across multiple languages, including R, Python, and Julia, and is positioned as the modern successor to R Markdown. Posit actively develops and promotes it as the current default…
R Markdown
R Markdown documents mix Markdown-formatted text with chunks of R code, rendering into HTML, PDF, or Word output with the code's results embedded directly. It predates Quarto and was the standard tool for this kind of work for many years, so a large amount of existing documentation and tutorials still use it.…
Stage 5: Type Conversion
Type Conversion
Type conversion is deliberately changing a value from one type to another, such as turning the character "5" into the numeric value 5 with as.numeric(). R also does this automatically in some situations, called coercion, which can cause quiet bugs when data doesn't convert the way you expect. Understanding both the…
Stage 6: Data Structures
Data Structures
This section covers the containers R uses to hold data: vectors, lists, and the various tabular formats. Nearly everything you do in R involves working with one of these structures.
Vectors
A vector is R's most basic data structure: an ordered collection of values that all share the same type. Nearly everything in R is built on vectors, including single values, which R treats as vectors of length one. Operations on vectors work element by element without needing an explicit loop, which is one of the…
Lists
A list is a flexible container that can hold elements of different types and lengths in a single object, unlike a vector, which requires uniform type. A single list might hold a character string, a numeric vector, and a data frame all at once. Accessing elements typically uses double brackets, [[ ]], to pull out a…
Matrices
A matrix is a two-dimensional grid of values, all of the same type, arranged in rows and columns. Matrices support standard linear algebra operations like multiplication, transposition, and inversion, making them the natural structure for mathematical computation in R. Unlike a data frame, every cell in a matrix…
Arrays
An array generalizes a matrix to more than two dimensions, storing values of a single type across any number of dimensions you specify. Arrays are less common in everyday data analysis than vectors or data frames, but they appear in specialized numerical and scientific computing contexts. R indexes into them using…
Factors
A factor represents categorical data, storing a fixed set of possible values called levels, such as "low", "medium", "high". Internally, R stores factors as integers mapped to those level labels, which is more memory-efficient than storing the same category repeatedly as text. Getting factor levels and their order…
Data Frames
A data frame is R's standard structure for tabular data, organized into rows and columns where each column can hold a different type but all values within a column share the same type. It's the structure you'll use for almost any real dataset loaded into R, whether from a CSV file, a database, or an API. Nearly…
Tibbles
A tibble is a modern variant of the data frame, introduced by the tidyverse, with a few behavioral differences designed to reduce surprises. Tibbles print more usefully in the console, showing only what fits on screen along with each column's type, and they refuse to silently drop dimensions the way base data…
Data Tables
A data table is the structure provided by the data.table package, built specifically for fast, memory-efficient operations on large datasets. It extends the data frame with a more concise syntax and internal optimizations that make filtering, grouping, and joining noticeably faster on big data. Many R users learn…
Stage 7: Functions
Functions
This section covers writing and using your own functions in R: how they accept inputs, return values, and interact with the rest of your code. Functions are the main way to package logic so it can be reused instead of repeated.
Arguments & Defaults
Function arguments are the inputs a function accepts, and default values let you specify what an argument should be if the caller doesn't provide one. Writing function(x, na.rm = FALSE) means na.rm defaults to FALSE unless the caller overrides it. R also supports ... to let a function accept a variable number of…
Scopes
Scoping determines which variables a function can see and use while it runs. R uses lexical scoping, meaning a function looks first inside itself, then in the environment where it was defined, not the environment where it was called from. Understanding scoping becomes especially important once you write nested…
Recursion
Recursion is when a function calls itself, typically to break a problem into smaller versions of the same problem until it reaches a simple base case. A classic example is calculating a factorial by having the function call itself with a smaller number each time. Recursive functions need a clear stopping condition,…
Apply Family
The apply family is a set of base R functions that apply another function to every element of a vector, list, or data structure, replacing many uses of explicit loops. lapply() always returns a list, sapply() tries to simplify the result into a vector or matrix, and vapply() works like sapply() but requires…
Stage 8: Error Handling
Error Handling
This section covers how to catch and respond to problems in your code instead of letting them crash your script outright. tryCatch() lets you run code that might fail and specify what should happen if it does, such as logging a message or returning a default value. This matters for any code that depends on…
Debugging
Debugging in R involves finding out why code isn't behaving as expected, using tools like browser(), which pauses execution at a specific line so you can inspect variables, and traceback(), which shows the sequence of function calls leading up to an error. RStudio and Positron both provide visual debugging tools…
Stage 9: Importing Data
Importing Data
This section covers getting data from outside sources into R, whatever form it originally comes in. Different sources, flat files, spreadsheets, web pages, and APIs, each need a different approach to load correctly.
CSV
CSV files store tabular data as plain text with values separated by commas, making them one of the most universal formats for exchanging data between tools. Base R can read them with read.csv(), though readr's readcsv() is faster and handles more edge cases well, such as inconsistent column types or unusual…
Excel
Excel files store data in a binary or XML-based format that differs from plain text files, often including multiple sheets and formatting within a single file. R doesn't read them with base functions, so packages like readxl are needed to extract the underlying data into a usable data frame. Reading Excel data…
Text
Plain text files store unstructured or loosely structured data without the strict comma or tab delimiters of a CSV or TSV file. Reading them into R might mean reading line by line for further parsing, or using a delimiter-aware function if the text has some consistent structure like tab separation. This is a common…
JSON
JSON is a structured text format built around nested key-value pairs, commonly returned by web APIs. Parsing it in R usually means using a package like jsonlite to convert the response into R data structures. Because JSON's nested structure often doesn't map directly onto a flat data frame, some restructuring is…
APIs
Web APIs let you request data over the internet from another service, typically returning it in JSON format. Fetching data from an API in R usually means making an HTTP request with a package like httr, then parsing the response. This combination of requesting and parsing is essential for working with any modern…
Web Scraping
Web scraping extracts data directly from a website's HTML when that data isn't offered through a proper API or downloadable file. The rvest package reads a webpage's HTML and lets you select specific elements using CSS selectors or XPath, pulling out text, tables, or links. It requires some understanding of how the…
tidyverse
The tidyverse is a collection of R packages designed to work together around a shared philosophy and consistent syntax for data science tasks. It includes packages for data manipulation, visualization, string handling, and more, all built to interoperate smoothly with the pipe operator. Learning the tidyverse's…
ggplot2
ggplot2 is the tidyverse's plotting package, built around the grammar of graphics, which describes any plot as a combination of data, a coordinate system, and layered elements mapped to aesthetics like position or color. Instead of choosing a fixed chart type, you build a plot by combining these pieces, which is…
dplyr
dplyr provides a small set of verbs for the most common data manipulation tasks: filtering rows, selecting columns, arranging order, and summarizing groups. These verbs are designed to read almost like plain English, making dplyr code easier to follow than equivalent base R code. It's the core data manipulation…
tidyr
tidyr handles reshaping data between different layouts, most notably converting between wide and long formats with pivotlonger() and pivotwider(). Many statistical functions and ggplot2 specifically expect data in a particular shape, so tidyr often bridges the gap between how data is stored and how it needs to look…
readr
readr provides fast, consistent functions for reading flat files like CSVs into R, such as readcsv(), as an improvement over base R's equivalent functions. It handles more edge cases well, like inconsistent column types or unusual encodings, and gives clearer feedback about how it parsed each column. It's typically…
purrr
purrr applies a function to each element of a list or vector and collects the results, similar in spirit to base R's apply family but with more consistent, predictable behavior. Its map() function always returns a list, while variants like mapdbl() return a vector of a specific type, making the expected output…
tibble
tibble is the tidyverse package that defines and supports the tibble data structure, a modern variant of the data frame. It provides functions for creating tibbles directly, converting existing data frames into tibbles, and controlling how they print in the console. Most other tidyverse packages return tibbles by…
stringr
stringr provides a consistent, well-documented set of functions for working with text, covering tasks like detecting patterns, extracting substrings, and combining strings. Every function follows a consistent naming pattern starting with str, such as strdetect() or strreplace(), making the package easier to learn…
forcats
forcats provides tools for working with factors, R's data type for categorical variables, making common tasks like reordering levels or lumping rare categories together more straightforward than base R. Functions like fctreorder() let you control the order categories appear in in plots and tables, which matters…
lubridate
lubridate makes working with dates and times considerably easier than base R alone. Functions like ymd(), mdy(), and dmy() parse dates written in different common formats without requiring a manually specified format string. It also provides clear tools for date arithmetic using durations, periods, and intervals,…
Stage 10: Data Cleaning
Data Cleaning
This section covers fixing messy, inconsistent, or incomplete data before it's ready for analysis. It includes converting types, cleaning text, handling missing values, and detecting outliers.
Casting Types
Casting converts a column to the correct type, such as turning character "42" into the numeric value 42. Data often arrives in the wrong type for analysis, especially numbers or dates stored as plain text. Getting the types right early avoids confusing errors later when a function expects a number but receives text…
Parsing Dates
Parsing dates handles the extra complexity of date formats, since something like "01/02/2024" could mean different things depending on locale conventions. Getting the format specification right, or using a package like lubridate that guesses common formats automatically, avoids silently misreading dates. This…
Encoding Categories
Encoding categories turns text labels into R's factor type, giving categorical data the structure needed for modeling and certain visualizations. It also involves deciding on the order categories should follow, since default alphabetical ordering isn't always meaningful. This step usually comes after the raw text…
Stage 11: Data Manipulation
Data Manipulation
This section covers the core tasks of reshaping and transforming data once it's already loaded into R: filtering, grouping, joining, and more. Most real analysis work happens here, between importing raw data and producing final results.
strip, replace, split
Stripping removes leading or trailing whitespace from text, replacing swaps out unwanted characters or patterns for something else, and splitting breaks a single string into multiple parts based on a delimiter. These are usually among the first steps in cleaning any dataset with free-text or inconsistently…
Filter, Query, Arrange
Filtering keeps rows matching a condition, querying more broadly covers selecting the specific subset of data you need, and arranging sorts rows by one or more columns. In dplyr, these map to filter() and arrange(), both designed to read almost like plain English. Together they cover a large share of everyday data…
Group By & Summarize
Grouping splits a data frame into groups based on one or more columns, and summarizing then collapses each group down to a single summary row, such as a group's average or count. Together they replace the need for manual loops when calculating statistics per category, like average sales per region. This pattern is…
Mutate & Transform
Mutating adds new columns or changes existing ones in a data frame, calculating values across every row based on an expression you specify. Multiple new columns can be created in a single step, with later columns able to reference ones created earlier in the same step. This is one of the most frequently used data…
Window Functions
Window functions calculate a value for each row based on a set of related rows, without collapsing the data the way summarizing does. Ranking each row within its group, calculating a running total, or comparing a row's value to the previous row are all window function tasks. They're typically combined with…
Joins
Joins combine two data frames based on matching values in one or more shared columns, similar to joins in SQL. An inner join keeps only rows with matches in both tables, a left join keeps all rows from the first table and fills in matches where available, and a full join keeps all rows from both regardless of…
Reshaping
Reshaping changes the layout of a dataset without changing its underlying content, most commonly converting between wide and long formats. Wide format spreads related values across separate columns, while long format stacks them into fewer columns with an extra column identifying what each value represents. Many…
Map Functions
Map functions apply a function to every element of a list or vector and collect the results, avoiding the need for an explicit loop. purrr's map() always returns a list, while variants like mapdbl() return a vector of a specific type, making the expected output explicit. This becomes especially useful for iterating…
Working with Data Tables
Working with data tables means using the data.table package's syntax and conventions for fast, memory-efficient data manipulation on large datasets. It uses a distinctive bracket-based syntax, dt[i, j, by], differing from both base R indexing and dplyr's verb-based approach. It's typically reached for once dataset…
Stage 12: Strings and Dates
Strings and Dates
This section covers handling text and date or time data, two of the most common sources of messy, inconsistently formatted values in real datasets. Getting comfortable here pays off across nearly every other part of data analysis.
String Manipulation
String manipulation covers searching, extracting, replacing, and combining text values, most commonly using the stringr package's consistent str functions. Text data shows up constantly in real datasets: names, categories, free-text responses. Getting comfortable with these operations resolves a large share of…
Regular Expressions
Regular expressions are a pattern-matching language for describing sequences of characters, used to search, validate, or extract specific pieces of text. A pattern like ^\d{3}-\d{4}$ might describe a phone number format, matching only text that fits that exact shape. They take practice to read fluently, but solve…
R Dates & Times
Base R represents dates and times using specific classes: Date for calendar dates and POSIXct for date-times that include a time component. These classes let you do arithmetic directly, like subtracting two dates to get the number of days between them. Parsing dates correctly requires knowing the format they were…
isnull, isna
Detecting missing values in R relies on is.na(), since direct comparison like NA == NA doesn't return TRUE the way you might expect. This function returns a logical vector marking which values are missing, which can then be summed to count them or used to filter rows. It's the starting point before deciding how to…
Dropping vs. Imputing
Once missing values are found, you have to decide whether to drop rows containing them, which is simple but can lose real information, or impute them, replacing missing values with an estimate like the column mean. The right choice depends heavily on why the data is missing and how much of it there is. Dropping too…
Forward / Backward Fill
Forward and backward fill are common in time series data, carrying the last known value forward or the next known value backward to fill gaps. This assumes a value likely stayed the same or is reasonably close to nearby recorded values. It's a simpler alternative to statistical imputation, often used when data is…
IQR
The IQR method for detecting outliers flags values that fall well below or above the interquartile range, the range between the 25th and 75th percentile of the data. It's a robust approach, less sensitive to extreme values than methods based on the mean and standard deviation. It's commonly visualized directly…
Z-score
The Z-score method flags values a certain number of standard deviations away from the mean, commonly using a threshold like 2 or 3. It works well for roughly normally distributed data, but poorly for data that's heavily skewed, since the mean and standard deviation themselves get distorted by skew. It gives a…
Visual Inspection
Visual inspection uses plots, most often boxplots or scatterplots, to spot outliers by eye rather than through a fixed numeric rule. This often reveals context that purely numeric methods miss, such as whether an unusual value looks like a data entry error or a genuine rare event. It's frequently used alongside…
Stage 13: Exploratory Data Analysis
Exploratory Data Analysis
This section covers the first, applied pass at understanding a new dataset: summarizing it numerically and visually before any deeper modeling. It's usually the step right after data cleaning and right before serious statistical analysis.
Summary Statistics
Summary statistics condense a column of data down to a few representative numbers, like the mean, median, and standard deviation. They form the foundation for almost every deeper statistical technique, since you need to understand a variable's basic behavior before modeling relationships involving it. Calculating…
Distribution Analysis
Distribution analysis looks at how values in a dataset are spread across their range, most commonly using histograms and boxplots. A histogram groups values into bins and shows how many observations fall into each, revealing shape characteristics like skewness. A boxplot summarizes a distribution's median,…
Relationship Analysis
Relationship analysis examines how two or more variables relate to each other, using tools like scatterplots for two numeric variables, correlation matrices for many numeric variables at once, and cross-tabulation for categorical variables. This is usually the second step in exploratory analysis, after looking at…
Stage 14: Base R Plotting
Base R Plotting
Base R includes plotting functions like plot(), hist(), and boxplot() that don't require any additional package. They're quick to use for a fast look at data and require no setup. Base R plots are generally less polished and more manual to customize than ggplot2, since you build them up layer by layer using…
Stage 15: ggplot2
ggplot2
ggplot2 is a data visualization package that follows the grammar of graphics, a system for describing and building graphs by combining independent components. It allows users to create complex plots by layering elements such as data, coordinate systems, and visual mappings. By providing a consistent and structured…
Common Plots
Common plot types include line plots for trends over time, bar plots for comparing quantities across categories, histograms for showing the distribution of a single numeric variable, and boxplots for summarizing spread and outliers. Each type suits a different kind of question about the data. Learning when to reach…
Grammar of Graphics
The grammar of graphics is the conceptual framework ggplot2 is built on, describing any plot as a combination of data, a coordinate system, and layered geometric elements mapped to aesthetics. Instead of choosing a fixed chart type, you build a plot by combining these pieces, which is why the same underlying…
Aesthetic Mappings
Aesthetic mappings connect columns in your data to visual properties of a plot, like position, color, size, or shape. Writing aes(x = year, y = revenue, color = region) tells ggplot2 to plot year against revenue and color each point by region. Choosing the right aesthetics for the right variables makes the…
Overplotting Techniques
Overplotting happens when too many data points overlap on a plot, making it hard to see the true density or pattern, especially common with large datasets. Jittering adds small random noise to point positions to spread out overlapping points slightly. Transparency, adjusted through the alpha setting, lets…
Faceting & Themes
Faceting splits a single plot into a grid of smaller plots, one for each level of a categorical variable, making it easy to compare patterns across groups side by side. Themes control the overall visual styling of a plot, like background color, gridlines, and font sizes. Together they cover much of the difference…
Best Practices
Good data visualization practice means choosing chart types and design choices that communicate data accurately rather than misleadingly. Common anti-patterns include truncated axes that exaggerate differences and color choices that aren't accessible to colorblind viewers. A technically correct chart can still…
Stage 16: Dashboards
Dashboards
Dashboards present data and analysis interactively, typically through a web page with charts, filters, and controls a viewer can adjust themselves. They're built either through general business intelligence tools or R-native frameworks, depending on the audience and existing tooling in an organization. This section…
Power BI / Tableau
Power BI and Tableau are business intelligence tools for building dashboards, connecting to data sources and creating interactive visualizations largely through a visual interface rather than code. R can connect to both, either as a data source feeding into them or, in Power BI's case, running R scripts directly…
Shiny
Shiny is a framework for building interactive web applications directly in R, without needing to know HTML, CSS, or JavaScript. An app has two main parts: a UI defining what the user sees, and a server function defining how the app responds when the user interacts with those elements. This reactive model…
Stage 17: Interactive Plots
Interactive Plots
Interactive plots let viewers hover over points for details, zoom into a region, or toggle categories on and off, rather than viewing a fixed, static image. They work particularly well in dashboards, reports viewed in a browser, or any context where the audience benefits from exploring the data themselves. They…
plotly
plotly creates interactive charts that let viewers hover, zoom, and filter directly in the browser. It can convert many existing ggplot2 plots into interactive versions with a single function call, or build interactive charts directly with its own syntax. It's the most common package in R for adding this kind of…
Stage 18: Statistical Analysis
Statistical Analysis
This section covers the classical statistical techniques used to summarize data, test hypotheses, and model relationships between variables. It's the theoretical and methodological core underneath a lot of applied data work.
stats
stats is the base R package that ships with every R installation, providing core statistical functions like lm() for regression, t.test() for hypothesis testing, and functions for common probability distributions. It requires no separate installation since it's part of base R itself. Many higher-level statistics…
rstatix
rstatix provides a tidyverse-friendly interface for common statistical tests, wrapping base R functions like t.test() and aov() in a syntax that fits naturally into a dplyr pipeline. It returns results as tidy data frames rather than the more complex object types base R statistical functions typically produce,…
Stage 19: Machine Learning
Machine Learning
This section covers building predictive and pattern-finding models from data, using R's modern modeling frameworks. It builds on the statistical foundations covered earlier in the roadmap.
tidymodels
tidymodels is a collection of R packages for building and evaluating machine learning models, designed to follow tidyverse conventions and work well with the pipe operator. It splits modeling into distinct, composable steps: preprocessing, specifying a model, fitting it, and evaluating results, each handled by a…
Descriptive Statistics
Descriptive statistics summarize the basic characteristics of a dataset: central tendency, spread, and shape. They form the foundation for almost every deeper statistical technique, since you need to understand a variable's basic behavior before modeling relationships involving it. R's base summary() function…
Probability Distributions
A probability distribution describes how likely different outcomes are for a random variable, such as the normal distribution or the binomial distribution for counting successes in repeated trials. R provides functions for common distributions following a consistent naming pattern: d for density, p for cumulative…
Sampling
Sampling covers the different methods for selecting a subset of a population to study, when studying the entire population isn't feasible, including simple random, stratified, and cluster sampling. It also covers the mechanics of random number generation in R and setting a seed for reproducibility. The right…
Correlation
Correlation measures the strength and direction of a linear relationship between two numeric variables, expressed as a single number between negative one and positive one. A value near positive one means the variables tend to increase together, and near zero means little linear relationship exists. Correlation does…
Linear Regression
Linear regression models the relationship between a numeric outcome and one or more predictor variables, fitting a straight line, or hyperplane with multiple predictors, that best describes the relationship. R's lm() function fits linear models with a simple formula syntax, like lm(sales ~ advertising). Checking…
Logistic Regression
Logistic regression models a binary outcome, like whether an event happens or not, as a function of one or more predictor variables. It predicts the probability of the outcome falling into one category, using the glm() function with a logistic link in R. It's one of the most widely used models for classification…
Hypothesis Testing
Hypothesis testing provides a formal framework for deciding whether an observed pattern in data is likely real or could plausibly have occurred by chance alone. It starts with a null hypothesis, typically stating there's no effect, and calculates a p-value representing how surprising the observed data would be if…
Time Series Analysis
Time series analysis studies data collected sequentially over time, where the order of observations carries meaning that would be lost if the rows were shuffled. It involves identifying trends, seasonal patterns, and autocorrelation, where a value depends on its own previous values. Forecasting models use these…
Stage 20: NLP
NLP
NLP, or natural language processing, covers techniques for analyzing and extracting meaning from text data, such as tokenizing, measuring sentiment, or discovering topics across a collection of documents. R has a mature set of packages for this kind of work, ranging from tidyverse-friendly tools to faster, more…
tidytext
tidytext applies tidyverse conventions to text analysis, representing tokenized text as a data frame with one row per word. This tidy structure lets you use familiar dplyr verbs to filter, count, and summarize text data, rather than working with specialized text-only data structures. It's typically the entry point…
quanteda
quanteda is a faster, more powerful text analysis package built for working with large corpora of documents, offering more advanced features than tidytext for tasks like document-feature matrices and topic modeling. It trades some of tidytext's tidyverse-native simplicity for more performance and specialized…
Stage 21: Network Analysis
Network Analysis
Network analysis studies relationships between entities, represented as a graph of nodes connected by edges, such as people connected by friendships or web pages connected by links. It covers identifying influential nodes, detecting clusters or communities within a network, and visualizing the overall structure.…
igraph
igraph is the standard R package for building, analyzing, and visualizing network graphs. It provides tools for calculating centrality measures, detecting communities, and computing paths between nodes, covering most of the core graph theory operations needed. It's the foundation many other network analysis tools…
tidygraph
tidygraph applies tidyverse conventions to network data, letting you manipulate graph nodes and edges using familiar dplyr-style verbs instead of igraph's more specialized syntax. It works alongside ggraph for visualization, together forming a tidyverse-native alternative to working with igraph directly. It's often…
Stage 22: Geospatial Analysis
Geospatial Analysis
Geospatial analysis works with data tied to specific locations on Earth, using specialized structures and tools for handling coordinates, boundaries, and spatial relationships. It covers both vector data, like points and polygons, and raster data, like satellite imagery. This is a distinct application area…
sf
sf handles vector spatial data in R, representing points, lines, and polygons, such as store locations or country boundaries. It's built around simple features, a standard format for representing spatial data used across many GIS tools beyond just R. It's the modern standard for vector geospatial work in R, having…
terra
terra handles raster data in R, grids of values like satellite imagery or elevation data, and has replaced the older, now retired raster package. It provides functions for reading, manipulating, and analyzing raster layers, including operations like resampling and calculating values across a grid. It's the standard…
tmap
tmap creates thematic maps in R, designed specifically for visualizing spatial data like sf objects with a syntax inspired by ggplot2's layered approach. It supports both static maps for reports and interactive maps for exploration, switching between the two with a single setting. It's commonly used as the…
leaflet
leaflet creates interactive, web-based maps in R, built on top of the popular Leaflet.js JavaScript library. Unlike static maps, leaflet maps let viewers pan, zoom, and click on individual features to see more detail. It integrates well with Shiny apps, letting map interactions trigger updates elsewhere in a dashboard.
Stage 23: Big Data Tools
Big Data Tools
This section covers working with datasets too large or too slow to handle comfortably with standard R data manipulation tools. It includes techniques for parallelizing computation and connecting to distributed processing systems.
Parallel Computing
Parallel computing splits a computational task across multiple processor cores at once, rather than running everything sequentially, cutting the total time for tasks that can be broken into independent pieces. R provides tools like the parallel package's parLapply() for distributing work across a cluster of R…
Sparklyr
Sparklyr connects R to Apache Spark, a distributed computing framework built for processing datasets far too large to fit in memory on a single machine. It lets you write familiar dplyr syntax that gets translated into Spark operations running across a cluster of machines. It matters specifically once a dataset…
Questions about the R Programming Roadmap
Is the R Programming Roadmap free?
Yes. All 129 lessons in this roadmap are free to read on Bibha AI Learning Labs, with no account and no payment. Signing in is optional: it lets you mark lessons as done and keep your progress, and it opens the AI tutor, which runs on your own API key.
How long does the R Programming Roadmap take?
There is no fixed duration. It has 129 lessons in 23 stages, and the time it takes depends on how many hours you give it each week. Nothing is locked, so you can skip what you already know, and your progress is saved once you sign in.
Where should I start the R Programming Roadmap?
Start with stage 1, Introduction, and work down in order. The stages are numbered in the order the roadmap suggests, but every lesson is open, so if you already know Introduction you can go straight to Setting Up or anything after it. Each lesson links to free resources for going deeper.
Can I learn R Programming in Hindi?
The lessons are written in English. Once you sign in, you can ask the AI tutor on any lesson to explain it in Hindi or Hinglish. It answers from that lesson’s own text, so the explanation stays on the syllabus. The tutor runs on your own Google, OpenAI or Anthropic key.