This cheat sheet will help you to get yourself up to speed in no time! R For Data Science Cheat Sheet: xts eXtensible Time Series (xts) is a powerful package that provides an extensible time series class, enabling uniform handling of many R time series classes by extending zoo. An Introduction to R and RStudio Cheat sheet There are many R cheat sheets out there that provide brief summaries of functions and basic R operation (several of the better ones are listed in the resources section of this document).
Documentation#
Topic | Link |
---|---|
General | https://docs.rstudio.com/ |
Installing R | https://docs.rstudio.com/resources/install-r/ |
Installing Python | https://docs.rstudio.com/resources/install-python/ |
RStudio Server admin guide | https://docs.rstudio.com/ide/server-pro/ |
RStudio Connect admin guide | https://docs.rstudio.com/connect/admin/ |
RStudio Package Manager admin guide | https://docs.rstudio.com/rspm/admin/ |
Pro Drivers | https://docs.rstudio.com/pro-drivers/ |
Pre-requisites:
Installing R#
Install R from pre-compiled binaries#
Recommended best practise is to install R from pre-compiled binaries
R Cheat Sheet Pdf
For example, on Ubuntu 18.04 for R version 3.6.1.
This script installs into
/opt/R/...
Verify installation:
RStudio Server Pro#
Admin guide: https://docs.rstudio.com/ide/server-pro/
Starting, stopping and restarting#
![Cheat Cheat](/uploads/1/1/7/6/117648804/430077634.png)
Running the verify installation command:
To restart the RSP service and check its status, run these commands (with
sudo
if necessary):Status#
Error logs#
The locations of the various server log files:
The server log is at:
RStudio Connect#
Admin guide: https://docs.rstudio.com/connect/admin/
Config file#
Systemd vs upstart#
Distributions using systemd include Red Hat/CentOS 7, Red Hat/CentOS 8, SUSE 12, Ubuntu 16.04, and Ubuntu 18.04.
systemctl start rstudio-connect
Distributions using Upstart include Red Hat/CentOS 6 and Ubuntu 14.04.
start rstudio-connect
Starting and stopping#
Checking status#
Log files#
Get the diagnostics script#
RStudio Package Manager#
Admin guide: https://docs.rstudio.com/rspm/admin/
The rspm command#
Rstudio Cheat Sheet
Try running the
rspm
command on the server instance where RSPM is installed:To save keystrokes when typing RSPM commands, create a command alias for the
rspm
command:Run the
rspm
command with no arguments for a list of available commands:Working with CRAN#
Manage repositories and sources#
Manage packages#
Working with repositories#
Utilities#
System health check#
You have various methods to check the health of your RSPM instance:
- View the RSPM application logs:
- View the RSPM access logs:
- Check the status of your RSPM license:
- Run RSPM diagnostics:
- View diagnostics output:
License manager#
View license status#
Activate license:
List of available commands:
Supported commands:
Expired license#
Things to try:
- Check time and time zone
timedatectl
- Resync if needed, e.g.
sudo hwclock -w
- Restart
Deactivating a license#
![Cheatsheet Cheatsheet](/uploads/1/1/7/6/117648804/650034170.png)
Deactivation tool: http://apps.rstudio.com/deactivate-license/
Pro Drivers#
Documentation overview: https://docs.rstudio.com/pro-drivers/
Driver locations:
Troubleshooting#
Troubleshooting R#
Almost all RStudio products depend on R being installed successfully to run.
- Look for errors related to R in the server logs
Can R be launched manually and can the user's code be run in R without any errors?
How was R installed?
- From source or pre-compiled binaries? If so, were all correct flags and capabilities set?
Are all necessary dependencies installed?
Are the permissions set correctly to allow
r-x
by all? Are there multiple versions of R on the system?
R Studio Cheat Sheet Ggplot
Troubleshooting configuration#
Look for any errors in the startup. You can view the live log during startup using:
Rstudio Cheat Sheet Pdf
Read through the admin guides and make sure you have the correct formatting
Make sure you're on the right version of the product compared to the admin guide!
Troubleshooting authentication#
It is difficult for RStudio Support to troubleshoot as it depends on external configuration values unknown to us.
Does it work outside of the RStudio product?
- Often possible to copy over working setup from other systems or services.
- For RStudio Server Pro, the
pamtester
utility lets you test outside RStudio systems.
Check server log files including
access.log
files.Check connections to any external authentication providers
- Kerberos, Active Directory, etc.
General Linux tips#
Operating system version#
What OS are you using?
or
Export environment variable to PATH#
Persist changes on startup in .bashrc#
You can run scripts and define variables on startup by adding lines to your
.bashrc
file:R Markdown is a framework for writing versatile, reproducible reports from R. With R Markdown, you write a simple plain text report and then render it to create polished output. You can:
- Transform your file into a pdf, html, or Microsoft Word document—even a slideshow—at the click of a button.
- Embed R code into your report. When you render the file, R will run the code and insert its results into your report. Use this feature to add graphs and tables to your report: if your data ever changes, you can update your figures by re-rendering the report.
- Make interactive documents and slideshows. Your report becomes interactive when you embed Shiny code.
We’ve created a cheat sheet to help you master R Markdown. Download your copy here. You can also learn more about R Markdown at rmarkdown.rstudio.com and Introduction to R Markdown.
You may subscribe by Email or the RSS feed.
Categories
- Company News & Events (7)
- Data Science Leadership (41)
- Data visualization (1)
- Education (6)
- Events (9)
- Featured (41)
- Internships (3)
- News (116)
- Packages (175)
- R Markdown (26)
- RStudio (1)
- RStudio Cloud (3)
- RStudio Connect (38)
- RStudio IDE (82)
- RStudio Launcher Plugin SDK (1)
- RStudio Package Manager (12)
- RStudio Server Pro (1)
- Shiny (75)
- Training (49)
- packages (1)
- r-markdown (1)
- rstudio::conf (23)
- rstudio::global (2)
- shinyapps.io (10)
- tidyverse (35)