R Basics

When you open R for the first time you get a confusing looking program. Below is a screenshot of what you get when you open R for the first time.

A brief tour of R: The blue circle is the console window; the yellow circle contains several different tabs, files, plots, packages, and the help panel are located here; the green circle contains the environmental and history tabs, it also contains a preview of your workspace and a shortcut on how to import data into R.

The console window is the place where R does actual work. While you can do your work in the console window, you are encouraged NOT to work within the console window.

Instead you should work in a script file! There are several reasons you should work in a script file, but the most important is that you can easily replicate and repeat your work. To open a script file, on the top of the console window click the “new” document tab in the upper left corner.

After opening a new script file, your R Studio will add a script window. When you type a new line in the script window, it will not immediately be executed.