rguides

Tutorials

R Tutorials

Step-by-step series to learn R from scratch.

R Bayesian Stats

4 tutorials

  1. Introduction to Bayesian Thinking

    Learn the fundamentals of Bayesian statistics and how it differs from frequentist approaches. Understand priors, likelihoods, and posterior distributions.

  2. Getting Started with brms

    Learn how to fit Bayesian regression models in R using the brms package. Covers basic syntax, model fitting, and interpreting results.

  3. Prior Selection in Bayesian Models

    Learn how to choose appropriate prior distributions for Bayesian models in R. Covers prior types with practical brms examples.

  4. Posterior Predictive Checks for Model Validation in R

    Learn how to perform posterior predictive checks to validate your Bayesian models in R using brms and bayesplot.

R Data Visualization

11 tutorials

  1. ggplot2 Basics, Learn how to create data visualizations in R

    Learn how to create data visualizations in R using ggplot2's layered Grammar of Graphics approach. Everything composes with the operator.

  2. Introduction to ggplot2

    Learn the basics of ggplot2, the most popular data viz package in R. Covers the grammar of graphics, aesthetic mappings, and creating your first plots.

  3. Customizing ggplot2 Charts: Themes, Colors, and Labels

    Customizing ggplot2 charts step by step: master themes, color scales, axis labels, legends, and faceting to build publication-ready data visualizations in R.

  4. Customizing ggplot2 Themes

    Learn to customize ggplot2 themes with theme(), element_text(), element_line(), and element_rect(). Build reusable themes for data visualizations.

  5. Faceting in ggplot2, Split your plots into panels to compare

    Split your plots into panels to compare data subsets side by side. Learn facet_wrap() and facet_grid() with practical examples.

  6. Facets, Scales, and Themes in ggplot2

    Learn to create multi-panel plots with facets, customize scales for precise axis and color control, and apply professional themes in ggplot2.

  7. Advanced ggplot2 Geoms: Box, Violin, and Density Plots in R

    Master advanced ggplot2 geometries in R including box plots, violin plots, density plots, and multi-layer visualizations for exploring distributions.

  8. Maps with ggplot2: Create Choropleth and Bubble Maps in R

    Create maps with ggplot2 in R: build choropleth and bubble maps using sf, customize projections, and design publication-ready spatial visualizations.

  9. Interactive Plots with plotly

    Learn how to create interactive plots with plotly in R. Convert ggplot2 charts, customize tooltips, and build interactive dashboards.

  10. Publication-Ready Figures in R

    Learn how to export ggplot2 figures that meet journal standards—correct dimensions, DPI, embedded fonts, and colorblind-safe palettes.

  11. Creating Animated Charts with gganimate and ggplot2 in R

    Create animated charts with gganimate in R. Transform ggplot2 plots into smooth, shareable animations using transitions, reveals, and view follow.

R for Reporting

5 tutorials

  1. Getting Started with R Markdown

    Learn how to create reproducible reports and documents combining R code, output, and narrative text using R Markdown.

  2. Getting Started with Quarto — Create Dynamic Reports in R

    Getting started with Quarto for R. Create dynamic documents, reports, and presentations from code using Quarto's modern publishing workflow.

  3. Parameterised Reports with Quarto

    Learn to create flexible, reusable Quarto reports with parameters. Filter data, customize outputs, and render multiple versions from a single source file.

  4. Theming HTML Reports with R Markdown

    Learn how to customize the appearance of R Markdown HTML reports using built-in themes, the rmdformats package, and custom CSS.

  5. Building Dashboards with Quarto: Interactive Data Displays in R

    Building dashboards with Quarto in R: create interactive data displays with grid layouts, value boxes, and tabsets. Deploy static or Shiny-powered dashboards.

R for Statistics

6 tutorials

  1. Descriptive Statistics in R: Mean, Median, and Spread

    Descriptive statistics in R using base functions and tidyverse: calculate mean, median, variance, standard deviation, and quartiles step by step.

  2. Hypothesis Testing in R

    Learn how to perform hypothesis tests in R including t-tests, chi-square tests, and ANOVA. Covers p-values, significance levels, and interpreting results.

  3. Linear Regression in R

    Learn simple and multiple linear regression in R with lm(), including diagnostics, interpretation, predictions and visualization.

  4. Logistic Regression in R

    Learn how to build, interpret, and evaluate logistic regression models in R using the glm() function. Covers odds ratios, predictions, and model diagnostics.

  5. ANOVA in R, Learn how to perform Analysis of Variance (ANOVA)

    Learn how to perform Analysis of Variance (ANOVA) in R, including one-way ANOVA, two-way ANOVA, and post-hoc tests with practical examples.

  6. Regression Models in R: lm(), glm(), and Diagnostics

    Learn to fit, interpret, and diagnose linear and generalized linear regression models in R using lm() and glm().

R Fundamentals

8 tutorials

  1. Installing R and RStudio on Windows, macOS, and Linux

    Step-by-step guide for installing R and RStudio on Windows, macOS, and Linux. Verify your installation, write first R code, and set up packages.

  2. Working with Vectors and Atomic Types in R

    Master working with R vectors and atomic types — numeric, integer, character, logical — plus vectorized operations, type coercion, and subsetting.

  3. Data Frames and Tibbles in R: A Complete Tutorial

    Learn to create, manipulate, and transform data frames and tibbles in R—the essential structures for working with tabular data in R.

  4. Functions and Control Flow in R

    R functions control how code executes: write custom logic, use if-else for decisions, and handle repetition with loops for cleaner data analysis.

  5. Importing and Exporting Data in R

    Learn how to read and write data files in R, from basic CSV handling to Excel files and beyond. Working with data means getting it in and out of R.

  6. R Lists and Environments: A Complete Tutorial

    Master R lists and environments: create nested structures, understand lexical scoping, and use environments for namespaces and mutable state in your R code.

  7. Working with strings and factors in R: a tutorial

    Working with strings and factors in R — manipulate text, use regular expressions, create categorical factors with custom levels, and build ordered factors.

  8. Error Handling in R, Learn how to handle errors and exceptions

    Learn how to handle errors and exceptions in R using tryCatch, base R warning functions, and the purrr safely family for functional programming.

R Machine Learning

13 tutorials

  1. Introduction to Machine Learning in R

    A comprehensive beginner's guide to machine learning concepts, popular R packages like caret and tidymodels, and how to build your first ML model.

  2. Introduction to Supervised Learning in R

    Learn regression vs classification, then build your first models with the tidymodels framework in R. R has no shortage of machine learning packages.

  3. Hyperparameter Tuning in R

    Optimize ML models in R with grid search, random search, and Bayesian hyperparameter tuning using caret and tidymodels.

  4. Caret Classification in R: Train, Tune, and Evaluate Models

    Caret classification in R: train models, tune hyperparameters, evaluate with confusion matrices, and deploy classifiers using the unified caret framework.

  5. Random Forests in R, Train random forests in R with the

    Train random forests in R with the randomForest package and tidymodels, tune key hyperparameters, and interpret feature importance scores.

  6. Cross-Validation in R

    Learn how to evaluate machine learning models reliably using k-fold cross-validation, caret, and tidymodels in R.

  7. Tidymodels Regression: Build, Tune, and Evaluate Models in R

    Build, tune, and evaluate Tidymodels regression models in R. Covers data splitting, preprocessing, model fitting, cross-validation, and hyperparameter tuning.

  8. Random Forests in R — Build, Tune, and Interpret

    Build random forests in R with tidymodels — from data preparation through hyperparameter tuning to model evaluation and prediction, using the Titanic dataset.

  9. Gradient Boosting with xgboost

    Learn how to build powerful gradient boosting models in R. Covers basics, hyperparameters, tuning, and best practices for classification and regression.

  10. Model Evaluation and Cross-Validation

    Learn to evaluate ML models in R with train/test splits, k-fold cross-validation, and metrics like accuracy, precision, recall, F1, and ROC AUC.

  11. Feature Engineering in R: Transform Raw Data for ML Models

    Feature engineering in R: numeric scaling, categorical encoding, date extraction, and missing value imputation using tidyverse recipes and tidymodels.

  12. Model Evaluation Metrics in R

    Learn how to evaluate regression and classification models in R using caret, yardstick, and tidymodels with practical code examples.

  13. Building Classification Models with tidymodels in R

    Building classification models with tidymodels in R: logistic regression, random forests, accuracy, ROC AUC, and confusion matrices.

R Package Development

7 tutorials

  1. Testing with testthat

    Learn to write unit tests in R with the testthat package, from basic assertions to fixtures and skipping tests.

  2. Writing Vignettes in R

    Learn how to write package vignettes in R, the narrative articles that walk users through real-world workflows and explain how your package fits together.

  3. Submitting to CRAN, Learn how to package, document, check, and

    Learn how to package, document, check, and submit your R package to CRAN, with practical advice on responding to reviewer feedback.

  4. R Package Structure, The files, directories, and conventions

    The files, directories, and conventions that define an R package, from DESCRIPTION to vignettes. Every R package follows a fixed directory layout.

  5. DESCRIPTION and NAMESPACE Files

    Learn what DESCRIPTION and NAMESPACE files do in an R package, the manifest and namespace contract every package needs.

  6. Documenting with roxygen2

    Write roxygen comments in your R source files to auto-generate Rd documentation for your package functions with devtools::document().

  7. Building Documentation Websites with pkgdown in R

    Guide to building documentation websites for R packages with pkgdown: installation, _pkgdown.yml config, navbar, articles, reference index, and deployment.

R Spatial Analysis

5 tutorials

  1. Introduction to Spatial Data in R

    Learn the fundamentals of working with spatial data in R. Cover vector and raster data, coordinate systems, and your first spatial visualizations.

  2. Spatial Data Analysis with sf and terra in R

    Spatial data analysis with sf and terra in R: transform coordinates, perform spatial joins, and process raster and vector GIS data with modern geospatial tools.

  3. Geocoding Addresses and Building Maps in R with Leaflet

    Geocoding addresses in R with tidygeocoder, converting to sf objects, and building static ggplot2 and interactive Leaflet maps for spatial visualization.

  4. Spatial Joins in R: A Complete Guide with sf

    A practical guide to combining geospatial datasets in R using sf and dplyr. Learn spatial joins based on geographic relationships, not common keys.

  5. Raster Analysis in R

    Perform advanced raster analysis in R using the terra package. Learn terrain analysis, zonal statistics, and multi-band operations.

R Text Mining

5 tutorials

  1. Introduction to Text Mining in R

    Learn the fundamentals of text mining in R with tidytext. Transform raw text into tidy structures and extract meaningful insights.

  2. Tidytext Basics, Master the core tidytext functions for text

    Master the core tidytext functions for text analysis in R. Learn tokenization, n-grams, and working with multiple documents.

  3. Sentiment Analysis in R

    Learn how to perform sentiment analysis on text data using R. Cover lexicon-based methods, sentiment scoring, and visualizing emotional trends.

  4. Topic Modeling with LDA in R

    Learn how to discover hidden topics in document collections using Latent Dirichlet Allocation (LDA) in R with the tidytext package.

  5. Text Classification in R with tidymodels: A Complete Guide

    Learn how to build supervised text classification models in R. Cover text preprocessing, feature extraction, and training classifiers.

R Web Development

3 tutorials

  1. Shiny for Python Developers

    A practical guide for Python developers learning Shiny for R. Maps familiar Streamlit and Gradio concepts to Shiny equivalents with clear code examples.

  2. Building a REST Client in R

    A practical guide to building reliable REST API clients in R using httr2. Learn error handling, retries, pagination, and auth patterns.

  3. R and Databases: Advanced Patterns

    Master advanced database patterns in R including connection pooling, parameterized queries, transaction management, and multi-database workflows.

Shiny Apps

4 tutorials

  1. Getting Started with Shiny

    Learn to build interactive web apps with R and Shiny. Covers UI, server, reactivity, and running your first app.

  2. Mastering Shiny Reactivity: Values, Expressions, and Observers

    Mastering Shiny reactivity: a guide to reactive values, expressions, observers, and the reactive graph. Learn how Shiny updates outputs when inputs change.

  3. Building UI Components in Shiny

    Learn how to build interactive user interface components in Shiny apps, including inputs, sliders, dropdowns, action buttons, and layout functions.

  4. Deploying Shiny Apps to shinyapps.io, Connect, and Docker

    A guide to deploying Shiny apps to shinyapps.io, Posit Connect, and Docker. Covers configuration, secrets, and production tradeoffs for each platform.

Tidyverse Workflow

12 tutorials

  1. Functional Programming with purrr

    Replace loops with purrr. Covers map, map2, pmap, walk, reduce, safely, and other functional programming tools in the tidyverse.

  2. Pivoting Data with tidyr

    Convert data between wide and long formats using tidyr's pivot_longer and pivot_wider functions, with practical examples.

  3. Introduction to the Tidyverse

    Learn the fundamentals of the Tidyverse—a collection of R packages for data science. Discover how dplyr, ggplot2, tidyr, and more transform data analysis.

  4. Data Manipulation with dplyr

    Data manipulation with dplyr in R. Master filter, select, mutate, arrange, group_by, and summarise to transform and aggregate data efficiently.

  5. Importing Data with readr

    Learn to import CSV, TSV, and delimited files into R using readr. Covers column types, locale settings, and common pitfalls.

  6. Reshaping Data with tidyr

    A complete guide to pivoting data between wide and long formats using tidyr's pivot_longer() and pivot_wider() functions.

  7. Fast File Import with readr

    Learn how to efficiently import flat files into R using the readr package. Covers CSV, TSV, delimited files, column types, and performance tips.

  8. Text Manipulation with stringr

    Manipulate text in R with stringr. Covers concatenation, pattern matching, regex, case conversion, trimming, padding, and interpolation inside dplyr pipelines.

  9. String Manipulation with stringr

    Master string manipulation in R with the stringr package. Learn pattern matching, string extraction, replacement, and whitespace handling.

  10. Functional Iteration with purrr

    Learn map(), map2(), pmap() for iterating over data and handle errors with safely(), possibly(), quietly(). It always returns a list.

  11. Using lubridate to Work with Dates and Times in R

    Using lubridate to work with dates and times in R: parse, format, extract components, compute durations, and handle timezones safely with the tidyverse.

  12. Handling Factors with forcats

    Handling factors with forcats in R: create, reorder, lump, and recode categorical data for statistical modeling and visualizations.