Getting Familiar with the R Studio Source Pane

[This article was first published on R in Trevor French on Medium, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

You may have been using R Studio for years without realizing what all of those buttons do. This graphic and corresponding annotations will walk you through how everything works.

a. Show in New Window- This allows you to pop the source pane into a new window by itself.

b. Save Current Document- This saves the file contained in the tab you currently have active.

c. Source on Save- Automatically sources your file every time you hit save. “Sourcing” is similar to “Running” in the sense that both will execute your code; however, sourcing will execute your saved file rather than sticking lines of code into the console.

d. Find/Replace- this feature allows you to find and replace specified text, similar to find and replace features in other tools such as Excel.

e. Code Tools- This brings up a menu of options which help you to code more efficiently. Some of these tools include formatting your code and help with function definitions.

f. Compile Report- This allows you to compile a report directly from an R script without needing to use additional frameworks such as R Markdown.

g. Run Current Selection- This allows you to highlight a portion of your code and run only that portion.

h. Re-run Previous Code Region- This option will execute the last section of code that you ran.

i. Go to Previous/Next Section/Chunk- These up and down arrows allow you to navigate through sections of your code without needing to scroll.

j. Source Contents- This option will save your active document if it isn’t already saved and then source the file.

k. Outline- Pressing this option will pop open an outline of your current file.

l. Adjust Frame Size- These two options will adjust the size of the source pane inside of R Studio.

m. Syntax Highlighting- This allows you to adjust the syntax highlighting of your active document to match the highlighting of other file types.

n. “Jump To” Menu- This menu allows you to quickly jump to different sections of your code.

o. Cursor Position- This displays your current cursor position by row and column.

p. Row Numbers- The left-hand side of your document will display the row number for each line of your code.

q. Back/Forward- These arrows are navigation tools that will allow you to redo/undo the following actions: opening a document (or switching tabs), going to a function definition, jumping to a line, and jumping to a function using the function menu. Reference: https://support.rstudio.com/hc/en-us/articles/200710523-Navigating-Code-in-the-RStudio-IDE

r. Tab- This is a tab in the traditional sense, meaning you are able to have a collection of documents open displayed as tabs. These tabs will have the title of your document and often an icon of some sort to demonstrate the file type.


Getting Familiar with the R Studio Source Pane was originally published in Trevor French on Medium, where people are continuing the conversation by highlighting and responding to this story.

To leave a comment for the author, please follow the link and comment on their blog: R in Trevor French on Medium.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)