Start here to learn R!

start here to learn RReady, set, go!

On R-exercises, you will find more than 1,000 R exercises. We’ve bundled them into exercise sets, where each set covers a specific concept or function. An exercise set typically contains about 10 exercises, progressing from easy to somewhat more difficult. In order to give you a full picture of all the amazing content on this website, we’ve categorized all sets into broader topics below.

Start at the beginning, or anywhere you want

If you’re completely new to R, we suggest you simply start with the first topic, “Vectors”. Once you’ve managed to work through all exercise sets, from top to bottom, you should have a fair amount of knowledge of, and practical experience with, using R. Of course, those of you who are familiar with R already, can jump straight to any of the topics below.

Enroll in an online R course

Also, consider enrolling in an online R course to speed up learning, for example R Programming A-Z™: R For Data Science With Real Exercises! if you’re a beginner, or R Programming: Advanced Analytics In R For Data Science if you’re already at an intermediate level. Or even better, check out our R Course Finder directory, which includes more than 140 R courses, and use its filters and search to quickly find the perfect R course that matches your level and interests!

Subscribe and share

New exercise sets are added on a daily basis. Subscribe to R-exercises to receive weekly updates and bonus sets by email. For Free! Read Why exercise and Celebrating our 100th Exercise Set to better understand our philosophy. If you enjoy our exercises, please share this page with your friends.

Have fun!

Exercise sets by Topic

Vectors and sequences

  1. Vectors [tutorial] [vol. 1] [vol. 2]
  2. Regular sequences [vol. 1] [vol. 2]
  3. Logical vectors and operators
  4. Missing Values
  5. Character vector exercises
  6. Index vectors

Object modes and attributes

  1. Mode exercises
  2. Practical used of R objects: Some examples

Factors

  1. Factor Exercises

Arrays and Matrices

  1. Matrix exercises [vol. 1] [vol. 2]
  2. Array exercises
  3. Bind exercises
  4. Matrix operations

Lists and dataframes

  1. List exercises [vol. 1] [vol. 2]
  2. Data frame exercises [vol. 1] [vol. 2]
  3. Merging Dataframes Exercises
  4. Accessing Dataframe Objects Exercises
  5. Apply functions to lists

Data Structures

  1. Data Structures
  2. Data Structures [part 1] [part 2]

Importing data

  1. Reading delimited data
  2. Scan exercises
  3. R-SQL
  4. Web scraping

Character strings

  1. Regular expressions part 1
  2. String manipulation
  3. [BONUS] Working with tm package and wordclouds *
  4. [BONUS] Character Functions *
  5. [BONUS] Character Functions (intermediate) *
  6. Character Functions (advanced)
  7. [BONUS] Introduction to Text Mining *

* Subscribe for free to access BONUS exercises and receive our weekly newsletter.

Tables

  1. data exploration with table
  2. Complex tables
  3. Cross Tabulation with Xtabs

Data manipulation

  1. Get-your-stuff-in-order-exercises
  2. Basic operations
  3. Summary statistics with aggregate()
  4. Data Shape Transformation With Reshape()
  5. Interactive Subsetting exercises
  6. Reshape 2 exercises
  7. Efficient data processing with apply
  8. Optimize data processing with sapply
  9. Sampling exercise [part 1]
  10. Select and query
  11. Let’s get started with dplyr
  12. Multivariate apply
  13. Data table exercises: keys and subsetting
  14. [BONUS] Tidy the data up! *
  15. Data Hacking with RDSTK [part 1] [part 2] [part 3]
  16. Data wrangling [part 1] [part 2] [part 3] [part 4] [part 5] [part 6]

* Subscribe for free to access BONUS exercises and receive our weekly newsletter.

Reproducible reporting

  1. R Markdown [Tutorial] [part 1] [part 2]

Dates/times

  1. As.Date()
  2. Lubridate [part 1] [part 2] [part 3]
  3. zoo time series exercises

Probability distributions

  1. Combinations exercises
  2. Lets Begin with something sample
  3. Generating data

Loops and conditional execution

  1. Conditional execution exercises [vol. 1] [vol. 2]
  2. Scripting Loops in R [vol. 1] [vol. 2]
  3. [BONUS] Simplifying For loops *

* Subscribe for free to access BONUS exercises and receive our weekly newsletter.

Functions

  1. Functions exercises [vol. 1] [vol. 2]
  2. Higher order functions
  3. User Defined Functions
  4. A Primer in Functional Programming in R [part 1]

Data visualization

  1. Start plotting data!
  2. Customize a scatterplot exercises
  3. Replicating plots: Boxplot
  4. Advanced base graphics
  5. Graphics parameters exercises
  6. 3D plotting exercises
  7. Igraph Network analysis [part 1] [part 2] [part 3]
  8. Shiny Apps [part 1] [part 2] [part 3] [part 4] [part 5] [part 6] [part 7] [part 8] [part 9] [part 10]
  9. Shiny Apps Layout [part 1] [part 2] [part 3] [part 4] [part 5] [part 6] [part 7] [part 8] [part 9] [part 10]
  10. GoogleVis [part 1] [part 2] [part 3] [part 4] [part 5] [part 6] [part 7] [part 8] [part 9]
  11. [BONUS] Shiny html tags
  12. Shapefiles
  13. Getting started with Plotly: basic plots
  14. Plotly: advanced plots and features
  15. Lattice graphs [part 1] [part 2]
  16. [BONUS] Rebuilding a Figure *
  17. Multi-panel Graphics
  18. Spatial Analysis with ggmap

* Subscribe for free to access BONUS exercises and receive our weekly newsletter.

Statistical Testing

  1. Independent t-test
  2. Paired t-test
  3. Nonparametric tests
  4. Frequency and chi-square test for independence

Experimental Design and Analysis

  1. One way ANOVA in R
  2. Two way ANOVA in R
  3. Repeated measures ANOVA in R
  4. One Way MANOVA
  5. Experimental Design

Statistics

  1. Examining data
  2. [BONUS] Working with and visualizing a confidence interval *
  3. Model evaluation [part 1] [part 2]
  4. Basic tree [part 1] [part 2]
  5. Intermediate tree [part 1] [part 2]
  6. Recursive partitioning and regression trees
  7. [BONUS] Evaluating a linear time series model *
  8. Hierarchical clustering
  9. Multiple regression [part 1] [part 2]
  10. [BONUS] ROC curves *
  11. Call Center Productivity Boosting with ML
  12. Correlation and Correlogram
  13. Introduction to Copulas [part 1] [part 2]
  14. Instrumental Variables [part 1] [part 2] [part 3]

* Subscribe for free to access BONUS exercises and receive our weekly newsletter.

Forecasting

  1. Time Series Exploration
  2. Linear Trend and ARIMA Models
  3. Exponential Smoothing
  4. Multivariate Regression
  5. ARIMAX model
  6. Forecasting for Small Business [part 1] [part 3] [part 4]

Investing

  1. Analysis of stock prices [part 1] [[part 2] [part 3]
  2. Shares analysis using Quantmod package
  3. using MANOVA to analysis the banking crisis

Other

  1. Best practices while writing R code Exercises
  2. Bioinformatics Tutorial with Exercises in R [part 1]
  3. [BONUS] Students’ Achievements Research Project *
  4. Unit Testing in R using testthat
  5. Data Science for Operational Excellence [part 1] [part 2] [part 3] [part 4] [part 5]
  6. Accessing and Manipulating Biological Databases [part 1] [part 2] [part 3]
  7. Manipulate Biological Data Using Biostrings Package [part 1] [part 2] [part 3] [part 4]

* Subscribe for free to access BONUS exercises and receive our weekly newsletter.

Stand alone series: Data preparation made simple

  1. Descriptive analytics, Part 0: Data Exploration
  2. Descriptive analytics, Part 1: Data Formatting
  3. Descriptive analytics, Part 2: Data Imputation
  4. Descriptive analytics, Part 3: Outlier Treatment
  5. Descriptive analytics, Part 4: Data Manipulation
  6. Descriptive analytics, Part 5: Data visualisation (continuous variables)
  7. Descriptive analytics, Part 5: Data visualisation (categorical variables)
  8. Descriptive analytics, Part 5: Data visualisation (spatial data)
  9. Descriptive analytics, Part 6: Interactive dashboard [part 1] [part 2]

Stand alone series: Data Science for Doctors

  1. Data Science for Doctors, Part 1: Data Display
  2. Data Science for Doctors, Part 2: Descriptive Statistics
  3. Data Science for Doctors, Part 3: Distributions
  4. Data Science for Doctors, Part 4: Inferential Statistics [part 1] [part 2] [part 3] [part 4] [part 5]
  5. Data Science for Doctors, Part 5: Cluster Analysis
  6. Data Science for Doctors, Part 6: Variable Importance

Stand alone series: Hacking statistics or: How I Learned to Stop Worrying About Calculus and Love Stats Exercises

  1. [part 1]
  2. [part 2]
  3. [part 3]
  4. [part 4]
  5. [part 5]