Rstudio Hidden Gems


There’s a bunch of features not very well known but a game changer in Rstudio. Sometimes these gems don’t appear in documentation or in cheatsheets.

What’s your hidden gem ?

My first addition to the topic:

Add a timestamp to your code chunk just type ts and then Shift + Tab

# Wed Feb 07 10:07:33 2018 ------------------------------


Reflow code with Ctrl + Shift + A


Yeah, a good one. But maybe it’s not so hidden as it appears in Keyboard quick reference (Alt + Shift + K)

But one of my favourites anyway.



You can assign a shortcut for “Go To Next Chunk” in RMarkdown documents. I usually assign Ctrl + Down Arrow


The cheatsheet link under the Help tab makes me happy. Its not hidden but even so it took me a while to “discover” it.


ctrl + . to find files or function.


Shift + Ctrl + r to insert a section heading or just a line to break up sections of code. Not a game changer really but saves you typing out a the # es


You can clear the screen by typing:


on your console.


Ctrl l is even shorter for that (and l as in löschen is easy to remember if you happen to a German)


= “Control-Limpiar” (clear screen) in Spanish :slight_smile:


Nice! But why can’t they format the date correctly? :smiling_imp:

Feature Request: timestamp in ISO8601-ish format

This would be awesome if there is a shortcut for this one:

Jump cursor to different section headings in Rmarkdown.

Please tell me it exists.


In R Markdown documents, you can use Ctrl + PageUp and Ctrl + PageDown to quickly jump to the previous and next section (including chunks).

You can also pop up the scope tree list using Shift + Alt + J (Ctrl + Shift + Alt + J on macOS).



Is there a hidden gem that allows me to type a comma outside of quotations?
When you type your first ", RStudio creates two marks right away, and your text goes in between. And so you type, let's say, c("foo"), and your cursor is currently between o and ". You need to place a comma after " to type the next argument, and my most common typo looks like this: c("foo," "bar")

Also, is there a hidden gem to indent / advance the code with TAB while inline? When I hit TAB inline, it's trying to bring up help or something, won't advance cursor.


You can type the double quotes (") again when you are done and it will move you to the outside of the quotes so you can add the comma and keep typing. Typing the " after the last o in foo does not create another double quote, it only moves the cursor.


You can create you own. Add it to Global options > code > snippets

snippet comma


Reflow code with Ctrl + Shift + A

I wish this worked with pipe chains!


Not sure if I would say it's hidden, (but I didn't see it for ages)

Find in Files

Searches your whole code base for strings and then allows you to click to jump to them (like resharper for visual studio)

Rename in scope
Ever had someone use a 1-letter variable name in 1500 lines of code? This lets you rename the actual variables called x not just replace each instance of x


Just recently found out that you can View() a data frame or package function within your script by CTRL+Left-clicking on their name.


Just recently found out that you can View() a data frame or package function within your script by CTRL+Left-clicking on their name.

I can't seem to figure out how to do this on Mac.... anyone?