RStudio Cheatsheets

RStudio Cheatsheets

The cheatsheets below make it easy to use some of our favorite packages. From time to time, we will add new cheatsheets. If you’d like us to drop you an email when we do, click the button below.

Subscribe to cheatsheet updates

Web APIs for R with plumber Cheatsheet

The Plumber package enables R developers to build web APIs. Plumber uses special R comments combined with standard R functions to create API endpoints. This cheatsheet provides everything you need to get started building APIs in R with Plumber. Updated March 21.


Python with R and Reticulate Cheatsheet

The reticulate package provides a comprehensive set of tools for interoperability between Python and R. With reticulate, you can call Python from R in a variety of ways including importing Python modules into R scripts, writing R Markdown Python chunks, sourcing Python scripts, and using Python interactively within the RStudio IDE. This cheatsheet will remind you how. Updated March 19.


Factors with forcats Cheatsheet

Factors are R’s data structure for categorical data. The forcats package makes it easy to work with factors. This cheatsheet reminds you how to make factors, reorder their levels, recode their values, and more. Updated February 19.


Tidy Evaluation with rlang Cheatsheet

Tidy Evaluation (Tidy Eval) is a framework for doing non-standard evaluation in R that makes it easier to program with tidyverse functions. Non-standard evaluation, better thought of as “delayed evaluation,” lets you capture a user’s R code to run later in a new environment or against a new data frame. The tidy evaluation framework is implemented by the rlang package and used by functions throughout the tidyverse. Updated November 18.


Deep Learning with Keras Cheatsheet

Keras is a high-level neural networks API developed with a focus on enabling fast experimentation. Keras supports both convolution based networks and recurrent networks (as well as combinations of the two),  runs seamlessly on both CPU and GPU devices,  and is capable of running on top of multiple back-ends including TensorFlowCNTK, and Theano. Updated December 17.


Dates and Times Cheatsheet

Lubridate makes it easier to work with dates and times in R. This lubridate cheatsheet covers how to round dates, work with time zones, extract elements of a date or time, parse dates into R and more. The back of the cheatsheet describes lubridate’s three timespan classes: periods, durations, and intervals; and explains how to do math with date-times. Updated December 17.


Work with Strings Cheatsheet

The stringr package provides an easy to use toolkit for working with strings, i.e. character data, in R. This cheatsheet guides you through stringr’s functions for manipulating strings. The back page provides a concise reference to regular expresssions, a mini-language for describing, finding, and matching patterns in strings. Updated October 17.


Apply Functions Cheatsheet

The purrr package makes it easy to work with lists and functions. This cheatsheet will remind you how to manipulate lists with purrr as well as how to apply functions iteratively to each element of a list or vector. The back of the cheatsheet explains how to work with list-columns. With list columns, you can use a simple data frame to organize any collection of objects in R. Updated September 17.


Data Import Cheatsheet

The Data Import cheatsheet reminds you how to read in flat files with, work with the results as tibbles, and reshape messy data with tidyr. Use tidyr to reshape your tables into tidy data, the data format that works the most seamlessly with R and the tidyverse. Updated January 17.


Data Transformation Cheatsheet

dplyr provides a grammar for manipulating tables in R. This cheatsheet will guide you through the grammar, reminding you how to select, filter, arrange, mutate, summarise, group, and join data frames and tibbles. (Previous version) Updated January 17.


Sparklyr Cheatsheet

Sparklyr provides an R interface to Apache Spark, a fast and general engine for processing Big Data.  With sparklyr, you can connect to a local or remote Spark session, use dplyr to manipulate data in Spark, and run Spark’s built in machine learning algorithms. Updated January 17.


R Markdown Cheatsheet

R Markdown is an authoring format that makes it easy to write reusable reports with R. You combine your R code with narration written in markdown (an easy-to-write plain text format) and then export the results as an html, pdf, or Word file. You can even use R Markdown to build interactive documents and slideshows. Updated February 16. (Old Version.


RStudio IDE Cheatsheet

The RStudio IDE is the most popular integrated development environment for R. Do you want to write, run, and debug your own R code? Work collaboratively on R projects with version control? Build packages or create documents and apps? No matter what you do with R, the RStudio IDE can help you do it faster. This cheatsheet will guide you through the most useful features of the IDE, as well as the long list of keyboard shortcuts built into the RStudio IDE. Updated January 16.


Shiny Cheatsheet

If you’re ready to build interactive web apps with R, say hello to Shiny. This cheatsheet provides a tour of the Shiny package and explains how to build and customize an interactive app. Be sure to follow the links on the sheet for even more information. Updated January 16.


Data Visualization Cheatsheet

The ggplot2 package lets you make beautiful and customizable plots of your data. It implements the grammar of graphics, an easy to use system for building plots. See for more. Updated November 16.


Package Development Cheatsheet

The devtools package makes it easy to build your own R packages, and packages make it easy to share your R code. Supplement this cheatsheet with, Hadley’s book on package development. Updated January 15.


R Markdown Reference Guide

R Markdown marries together three pieces of software: markdown, knitr, and pandoc. This five page guide lists each of the options from markdown, knitr, and pandoc that you can use to customize your R Markdown documents. Updated October 14.


Contributed Cheatsheets

These cheatsheets have been generously contributed by R Users.

Advanced R

Environments, data Structures, Functions, Subsetting and more by Arianne Colton and Sean Chen. Updated February 16.


Base R

Vectors, Matrices, Lists, Data Frames, Functions and more in base R by Mhairi McNeill. Updated March 15.



Bayesian cost effective analysis in R by Gianluca Baio.



Modeling and Machine Learning in R with the caret package by Max Kuhn. Updated September 17.



Thematic maps with spatial objects by Timothée Giraud. Updated August 18.



Advanced and fast data transformation with R by Sebastian Krantz. Updated November 20.



Data manipulation with data.table, cheatsheet by  Erik Petrovski. Updated August 18.



Tools to test research designs that use a MIDA framework. Updated April 19.



Fast, robust estimators for common models. Updated November 18.



R tools to access the eurostat database, by rOpenGov. Updated March 17.



A framework for building robust Shiny apps. By ThinkR. Updated September 19.



The R interface to h20’s algorithms for big data and parallel computing. By Juan Telleria. Updated April 18.


How big is your graph?

Graph sizing with base R by Stephen Simon. Updated October 16.



Impute missing data in time series by Steffen Moritz. Updated August 20.



Work with bayesian and classical statistical audit samples, by Koen Derks.



Manipulate labelled data by Joseph Larmarange. Updated July 20.



A reference to the LaTeX typesetting language, useful in combination with knitr and R Markdown, by Winston Chang. Updated January 18.



Interactive maps in R with leaflet, by Kejia Shi. Updated May 17.


Machine Learning Modelling

A tabular guide to machine learning algorithms in R, by Arnaud Amsellem. Updated March 18.



The mlr package offers a unified interface to R’s machine learning capabilities, by Aaron Cooley. Updated February 18.



The mosaic package is for teaching mathematics, statistics, computation and modeling. Cheatsheet by Michael Laviolette. Updated February 18.



The nardl package estimates the nonlinear cointegrating autoregressive distributed lag model. Cheatsheet by Taha Zaghdoudi. Updated October 18.



Hierarchical statistical models that extend BUGS and JAGS by Nimble development team. Updated May 20.



Work with Spatial Capture Recapture models. By Gabriella Palomo-Munoz.



Display descriptive information about a data set, by Cosima Meyer and Dennis Hammerschmidt.



Search CRAN with R by Joachim Zuckarelli.


Parallel Computation

Parallel computing in R with the parallel, foreach, and future packages. By Ardalan Mirshani. Updated March 19.



Quantitative Analysis of Textual Data in R with the quanteda package by Stefan Müller and Kenneth Benoit. Updated May 20.



Automate random assignment and sampling with randomizr. By Alex Coppock. Updated June 18.


Regular Expressions

Basics of regular expressions and pattern matching in R by Ian Kopacka. Updated September 16.



Optimal stratification for survey sampling. Cheatsheet by Giulio Barcaroli. Updated April 20.


Simple Features (sf)

Tools for working with spatial vector data: points, lines, polygons, etc. Cheatsheet by Ryan Garnett. Updated October 18.



dplyr friendly Data and Variable Transformation, by Daniel Lüdecke. Updated August 17.



Common translations from Stata to R, by Anthony Nguyen. Updated October 19.



Elegant survival plots, by Przemyslaw Biecek. Updated March 17.


Syntax Comparison

Three code styles compared: $, formula, and tidyverse. By Amelia McNamara. Updated February 18.


Teach R

Concise advice on how to teach R or anything else. By Adi Sarid. Updated March 19.


Time Series

A reference to time series in R. By Yunjun Xia and Shuyu Huang. Updated October 19.



A time series toolkit for conversions, piping, and more. By Christoph Sax. Updated May 19.



Tools for descriptive community ecology. Cheatsheey by Bruna L Silva. Updated April 20.



Visualize hierarchical subsets of data with variable trees. By Nick Barrowman. Updated October 19.



Explain statistical functions with XML files and xplain. By Joachim Zuckarelli. Updated May 18.



Chinese Translations - 中文翻译

Dutch Translations - Nederlandse Vertaling

French Translations - Traductions Françaises

  • caret translated by Ahmadou Dicko
  • Data Visualization translated by Vincent Guyader and Diane Beldame of ThinkR
  • Data Wrangling translated by Vincent Guyader and Diane Beldame of ThinkR
  • Quanteda translated by Ahmadou Dicko
  • RStudio IDE translated by Vincent Guyader and Diane Beldame of ThinkR
  • Shiny translated by Vincent Guyader and Diane Beldame of ThinkR

German Translations - Deutsch Übersetzungen

  • Base R translated by Annika Kies and Martin Kies from LeverageData
  • Data Transformation translated by Lucia Gjeltema of Research Triangle Analysts
  • Data Visualization translated by Lucia Gjeltema of Research Triangle Analysts
  • Data Wrangling translated by Lucia Gjeltema of Research Triangle Analysts
  • Package Development translated by Lucia Gjeltema of Research Triangle Analysts
  • R Markdown translated by Lucia Gjeltema of Research Triangle Analysts
  • Shiny translated by Lucia Gjeltema of Research Triangle Analysts
  • sparklyr translated by Ke Zhang

Greek Translations - Ελληνικές μεταφράσεις

  • Base R translated by Kleanthis Koupidis, Charalampos Bratsas, and Open Knowledge Greece
  • RStudio IDE translated by Kleanthis Koupidis, Charalampos Bratsas, and Open Knowledge Greece

Italian Translations - Traduzioni Italiane

  • Package Development translated by Angelo Salatino of Knowledge Media Institute
  • R Markdown translated by Angelo Salatino of Knowledge Media Institute
  • RStudio IDE translated by Angelo Salatino of Knowledge Media Institute

Japanese Translations - 日本語翻訳

Korean Translations - 한국어 로 번역

Persian Translations - ترجمه های فارسی

  • Data import translated by Vahid Faraji Jobehar and Reza Mazloomi

Portuguese Translations - tradução para português

Russian Translations - Переводы

  • Data Import translated by Evgeni Chasnovski of QuestionFlow
  • Data Transformation translated by Evgeni Chasnovski of QuestionFlow
  • Data Visualization translated by Kirill Voronov of Data Science(R)
  • lubridate translated by Evgeni Chasnovski of QuestionFlow
  • purrr translated by Evgeni Chasnovski of QuestionFlow

Spanish Translations - Traducciones en español

Turkish Translations - Türkçe Çeviriler

Ukrainian Translations - українські переклади

  • Data Import translated by Evgeni Chasnovski of QuestionFlow
  • Data Transformation translated by Evgeni Chasnovski of QuestionFlow
  • purrr translated by Evgeni Chasnovski of QuestionFlow
  • lubridate translated by Evgeni Chasnovski of QuestionFlow

Uzbek Translations - O‘zbek tilidagi tarjimalar

Vietnamese Translations - Bản dịch tiếng Việt

  • Base R translated by Anh Hoang Duc and Duc Pham of
  • Data Visualization translated by Anh Hoang Duc and Duc Pham of
  • Data Wrangling translated by Anh Hoang Duc and Duc Pham of
  • lubridate translated by Anh Hoang Duc and Duc Pham of
  • Package Development translated by Anh Hoang Duc and Duc Pham of
  • purrr translated by Anh Hoang Duc and Duc Pham of
  • R Markdown translated by Anh Hoang Duc and Duc Pham of
  • Shiny translated by Anh Hoang Duc and Duc Pham of
  • stringr translated by Anh Hoang Duc and Duc Pham of

Previous versions

To find previous versions of the cheatsheets, including the original color coded sheets, visit the Cheatsheet GitHub Repository.

Want to contribute?

We accept high quality cheatsheets and translations that are licenced under the creative commons license. Details and templates are available at How to Contribute a Cheatsheet.