RStudio orientation
RStudio panes
The large window (aka pane) on the left is the Console window. If you open or create a file, it is placed in the Source window, generally to the top left. The window on the top right is the Environments window (Environment / History / Connections) and the bottom right window is the Output window (Files / Plots / Packages / Help / Viewer). We will discuss each of these panes in turn below.
You can customise the location of each pane by clicking on the ‘Tools’ menu then selecting Global Options –> Pane Layout. You can resize the panes by clicking and dragging the middle of the window borders in the direction you want.
To set up RStudio to run the current line by pressing <CTRL><ENTER>, go to tools->global options->code. Set the Ctrl+Enter executes option to current line. I recommend doing this !
Console
The Console is where R evaluates all the code you write. You can type R code directly into the Console at the command line prompt, >. You can also highlight sections of code and press <Ctrl><Enter>. To highlight a line, click its number to the left, and to then highlight multiple lines, drag your mouse down or up.
Environment/History/Connections
The Environment / History / Connections window shows you lots of useful information. You can access each component by clicking on the appropriate tab in the pane.
· The ‘Environment’ tab displays all the objects you have created in the current (global) environment. Drop-down/list
· The ‘History’ tab contains a list of all the commands you have entered into the R Console.
· The ‘Connections’ tab allows you to connect to various data sources such as external databases.
Files/Plots/Packages/Help/Viewer
· The ‘Files’ tab lists all external files and directories in the current working directory on your computer. It works like file explorer (Windows) or Finder (Mac). You can open, copy, rename, move and delete files listed in the window.
· The ‘Plots’ tab is where all the plots you create in R are displayed (unless you tell R otherwise). Zoom/scroll/export
· The ‘Packages’ tab lists all of the packages that you have installed on your computer. You can also install new packages and update existing packages by clicking on the ‘Install’ and ‘Update’ buttons respectively.
· The ‘Help’ tab displays the R help documentation for any function.