The RStudio IDE is an Integrated Development Environment in that comes in three versions RStudio IDE Cheat Sheet Desktop IDE Open Source Server Professional Server learn more at www.rstudio.com A local version of the IDE for larger compute resources for teams that share large compute for your desktop and remote access resources, large data, and uniform environments for collaboration Download all at www.rstudio.com. Each provides the same useful interface: Documents and Apps Write Code R Support RStudio Pro Features

Navigate Open in new Save Find and Compile as Run Import data file History of past Display .RPres Share Project Active shared Start new R Session Open Shiny, R , with wizard commands to slideshows , , LaTeX, .Rd files tabs window replace notebook selected with Collaborators collaborators in current project code run/add to source File > New File > and more in Source Pane R Presentation Close R Session T H J in project Check Render Choose Choose Insert T H J spelling output output output code Select format location chunk R Version

Cursors of Re-run Source with or Show file Load Save Delete all Search inside Jump to Jump Run Publish Show file shared users previous code without Echo outline workspace workspace saved objects environment Project System previous to next selected to server outline chunk chunk lines Multiple cursors/column selection Choose environment to display from Display objects File > New Project with Alt + mouse drag. list of parent environments as list or grid RStudio saves the call history, Access markdown guide at Code diagnostics that appear in the margin. workspace, and working directory associated with a Help > Markdown Quick Reference Hover over diagnostic symbols for details. Name of current project project. It reloads each when Jump to Set knitr Run this and Run this Syntax highlighting based you re-open a project. chunk chunk all previous code chunk on your file's extension options code chunks Tab completion to finish RStudio opens plots in a dedicated Plots pane function names, file paths, Displays saved objects by View in data View function arguments, and more. type with short description viewer source code Multi-language code Navigate Open in Export Delete Delete snippets to quickly use recent plots window plot plot all plots common blocks of code. RStudio recognizes that files named app.R, GUI Package manager lists every installed package server.R, ui.R, and global.R belong to a shiny app Jump to function in file Change file type Create Upload Delete Rename Change folder file file file directory Install Update Create reproducible package Packages Packages library for your project Run Choose Publish to Manage Path to displayed directory app location to shinyapps.io publish Working Maximize, view app or server accounts Directory minimize panes Press ! to see Drag pane A File browser keyed to your working directory. Click to load package with Package Delete command history boundaries Click on file or directory name to open. library(). Unclick to detach version from package with detach() installed library Debug Mode Version Control with Git or SVN RStudio opens documentation in a dedicated Help pane Launch debugger Open traceback to examine Turn on at Tools > Project Options > Git/SVN Open with debug(), browse(), or a breakpoint. RStudio will open the mode from origin the functions that R called Stage Show file Commit Push/Pull View debugger mode when it encounters a breakpoint while executing code. of error before the error occurred files: diff staged files to remote History Home page of Search within Search for helpful links help file help file Click next to •A Added line number to •D Deleted Viewer Pane displays HTML content, such as Shiny apps, add/remove a M• Modified RMarkdown reports, and interactive visualizations breakpoint. •R Renamed Open shell to current •? Untracked type commands branch Highlighted Stop Shiny Publish to shinyapps.io, Refresh line shows Package Writing app rpubs, RSConnect, … where execution has File > New Project > View() opens spreadsheet like view of data set paused New Directory > Turn project into package, Run commands in Examine variables Select function Step through Step into and Resume Quit debug Enable roxygen documentation with environment where in executing in traceback to code one line out of functions execution mode Tools > Project Options > Build Tools execution has paused environment debug at a time to run Filter rows by value Sort by Search Roxygen guide at or value range values for value Help > Roxygen Quick Reference

RStudio® is a trademark of RStudio, Inc. • CC BY RStudio • [email protected] • 844-448-1212 • rstudio.com More cheat sheets at http://www.rstudio.com/resources/cheatsheets/ Learn more at support.rstudio.com • RStudio IDE 0.99.832 • Updated: 01/16 1 LAYOUT Windows/ Mac 4 WRITE CODE Windows /Linux Mac 5 DEBUG CODE Windows/Linux Mac Move focus to Source Editor Ctrl+1 Ctrl+1 Attempt completion Tab or Ctrl+Space Tab or Cmd+Space Toggle Breakpoint Shif+F9 Shif+F9 !/" !/" Move focus to Console Ctrl+2 Ctrl+2 Navigate candidates Execute Next Line F10 F10 Accept candidate Enter, Tab, or # Enter, Tab, or # Move focus to Help Ctrl+3 Ctrl+3 Step Into Function Shif+F4 Shif+F4 Dismiss candidates Esc Esc Show History Ctrl+4 Ctrl+4 Finish Function/Loop Shif+F6 Shif+F6 Undo Ctrl+Z Cmd+Z Show Files Ctrl+5 Ctrl+5 Continue Shif+F5 Shif+F5 Redo Ctrl+Shif+Z Cmd+Shif+Z Stop Debugging Shif+F8 Shif+F8 Show Plots Ctrl+6 Ctrl+6 Cut Ctrl+X Cmd+X Show Packages Ctrl+7 Ctrl+7 Copy Ctrl+ Cmd+C 6 VERSION CONTROL Windows/Linux Mac Show Environment Ctrl+8 Ctrl+8 Paste Ctrl+V Cmd+V Show diff Ctrl+Alt+D Ctrl+Option+D Show Git/SVN Ctrl+9 Ctrl+9 Select All Ctrl+A Cmd+A Commit changes Ctrl+Alt+M Ctrl+Option+M Show Build Ctrl+0 Ctrl+0 Delete Line Ctrl+D Cmd+D Scroll diff view Ctrl+!/" Ctrl+!/" 2 RUN CODE Windows/Linux Mac Select Shif+[Arrow] Shif+[Arrow] Stage/Unstage (Git) Spacebar Spacebar $ # $ # Search command history Ctrl+! Cmd+! Select Word Ctrl+Shif+ / Option+Shif+ / Stage/Unstage and move to next Enter Enter Select to Line Start Alt+Shif+$ Cmd+Shif+$ Navigate command history !/" !/" 7 MAKE PACKAGES Windows/Linux Mac Select to Line End Alt+Shif+# Cmd+Shif+# Move cursor to start of line Home Cmd+$ Select Page Up/Down Shif+PageUp/Down Shif+PageUp/Down Build and Reload Ctrl+Shif+B Cmd+Shif+B # Move cursor to end of line End Cmd+ Select to Start/End Shif+Alt+!/" Cmd+Shif+!/" Load All (devtools) Ctrl+Shif+L Cmd+Shif+L Change working directory Ctrl+Shif+H Ctrl+Shif+H Delete Word Lef Ctrl+Backspace Ctrl+Opt+Backspace Test Package (Desktop) Ctrl+Shif+T Cmd+Shif+T Interrupt current command Esc Esc Delete Word Right Option+Delete Test Package (Web) Ctrl+Alt+F7 Cmd+Alt+F7 Clear console Ctrl+L Ctrl+L Delete to Line End Ctrl+K Check Package Ctrl+Shif+E Cmd+Shif+E Quit Session (desktop only) Ctrl+Q Cmd+Q Delete to Line Start Option+Backspace Document Package Ctrl+Shif+D Cmd+Shif+D Restart R Session Ctrl+Shif+F10 Cmd+Shif+F10 Indent Tab (at start of line) Tab (at start of line) 8 DOCUMENTS AND APPS Windows/Linux Mac Run current line/selection Ctrl+Enter Cmd+Enter Outdent Shif+Tab Shif+Tab Preview HTML (Markdown, etc.) Ctrl+Shif+K Cmd+Shif+K Run current (retain cursor) Alt+Enter Option+Enter Yank line up to cursor Ctrl+U Ctrl+U Knit Document (knitr) Ctrl+Shif+K Cmd+Shif+K Run from current to end Ctrl+Alt+E Cmd+Option+E Yank line afer cursor Ctrl+K Ctrl+K Compile Notebook Ctrl+Shif+K Cmd+Shif+K Run the current function Ctrl+Alt+F Cmd+Option+F Insert yanked text Ctrl+Y Ctrl+Y Compile PDF (TeX and Sweave) Ctrl+Shif+K Cmd+Shif+K definitionSource a file Ctrl+Shif+O Cmd+Shif+O Insert <- Alt+- Option+- Insert chunk (Sweave and Knitr) Ctrl+Alt+I Cmd+Option+I Source the current file Ctrl+Shif+S Cmd+Shif+S Insert %>% Ctrl+Shif+M Cmd+Shif+M Show help for function F1 F1 Insert code section Ctrl+Shif+R Cmd+Shif+R Source with echo Ctrl+Shif+Enter Cmd+Shif+Enter Show source code F2 F2 Re-run previous region Ctrl+Shif+P Cmd+Shif+P 3 NAVIGATE CODE Windows /Linux Mac unctionNew document Ctrl+Shif+N Cmd+Shif+N Run current document Ctrl+Alt+R Cmd+Option+R Goto File/Function Ctrl+. Ctrl+. New document (Chrome) Ctrl+Alt+Shif+N Cmd+Shif+Alt+N Run from start to current line Ctrl+Alt+B Cmd+Option+B Fold Selected Alt+L Cmd+Option+L Open document Ctrl+O Cmd+O Run the current code section Ctrl+Alt+T Cmd+Option+T Unfold Selected Shif+Alt+L Cmd+Shif+Option+L Save document Ctrl+S Cmd+S Run previous Sweave/Rmd code Ctrl+Alt+P Cmd+Option+P Close document Ctrl+W Cmd+W Fold All Alt+O Cmd+Option+O Run the current chunk Ctrl+Alt+C Cmd+Option+C Close document (Chrome) Ctrl+Alt+W Cmd+Option+W Unfold All Shif+Alt+O Cmd+Shif+Option+O Run the next chunk Ctrl+Alt+N Cmd+Option+N Go to line Shif+Alt+G Cmd+Shif+Option+G Close all documents Ctrl+Shif+W Cmd+Shif+W Extract function Ctrl+Alt+X Cmd+Option+X Sync Editor & PDF Preview Ctrl+F8 Cmd+F8 Jump to Shif+Alt+J Cmd+Shif+Option+J Extract variable Ctrl+Alt+V Cmd+Option+V Switch to tab Ctrl+Shif+. Ctrl+Shif+. Previous plot Ctrl+Alt+F11 Cmd+Option+F11 Reindent lines Ctrl+I Cmd+I Next plot Ctrl+Alt+F12 Cmd+Option+F12 Previous tab Ctrl+F11 Ctrl+F11 (Un)Comment lines Ctrl+Shif+C Cmd+Shif+C Next tab Ctrl+F12 Ctrl+F12 Reflow Comment Ctrl+Shif+/ Cmd+Shif+/ Show Keyboard Shortcuts Alt+Shif+K Option+Shif+K First tab Ctrl+Shif+F11 Ctrl+Shif+F11 Reformat Selection Ctrl+Shif+A Cmd+Shif+A Last tab Ctrl+Shif+F12 Ctrl+Shif+F12 Select within braces Ctrl+Shif+E Ctrl+Shif+E Why RStudio Server Pro? Navigate back Ctrl+F9 Cmd+F9 Show Diagnostics Ctrl+Shif+Alt+P Cmd+Shif+Alt+P Do everything you would do with the open source server with a Navigate forward Ctrl+F10 Cmd+F10 Transpose Letters Ctrl+T commercial license, support, and more. ! " ! " Jump to Brace Ctrl+P Ctrl+P Move Lines Up/Down Alt+ / Option+ / • edit the same project at the same time as others !/" !/" Select within Braces Ctrl+Shif+Alt+E Ctrl+Shif+Alt+E Copy Lines Up/Down Shif+Alt+ Cmd+Option+ • switch easily from one version of R to a different version Add New Cursor Above Ctrl+Alt+Up Ctrl+Alt+Up Use Selection for Find Ctrl+F3 Cmd+E • open and run multiple R sessions simultaneously Add New Cursor Below Ctrl+Alt+Down Ctrl+Alt+Down see what you and others are doing on your server Find in Files Ctrl+Shif+F Cmd+Shif+F Move Active Cursor Up Ctrl+Alt+Shif+Up Ctrl+Alt+Shif+Up • tune your resources to improve performance Find Next Win: F3, Linux: Ctrl+G Cmd+G Move Active Cursor Down Ctrl+Alt+Shif+Down Ctrl+Alt+Shif+Down • Find Previous W: Shif+F3, L: Ctrl+Shif Cmd+Shif+G Find and Replace Ctrl+F Cmd+F • integrate with your authentication, authorization, and audit practices Jump to Word +GCtrl+ $/# Option+ $/# Use Selection for Find Ctrl+F3 Cmd+E Download a free 45 day evaluation at Jump to Start/End Ctrl+!/" Cmd+!/" Replace and Find Ctrl+Shif+J Cmd+Shif+J www.rstudio.com/products/rstudio-server-pro/

RStudio® is a trademark of RStudio, Inc. • CC BY RStudio • [email protected] • 844-448-1212 • rstudio.com More cheat sheets at http://www.rstudio.com/resources/cheatsheets/ Learn more at support.rstudio.com • RStudio IDE 0.99.832 • Updated: 01/16