Introduction to RStudio
Differences between R and RStudio
Here are screenshots of what R (left) and RStudio (right) look like:


Using an analogy from Moderndive.com, R is like the engine of your car, while RStudio is like the dashboard. The R language runs the computations, like an engine, while RStudio's interface makes it easier to understand and use the "engine", R. We will use RStudio for all of our R analyses because it not only gives us access to the engine, but the interactive features that allow us to use R more effectively.
RStudio Layout
RStudio is separated into four panes and shown below are some of the more useful features in each pane:
| Script Window | Environment, |
| History | |
| Console Window | Files, Plots, |
| Packages, Help | |
- Console Window - This is where R code is run. R, by itself, is just this component. When you exit out of RStudio, everything that has been run in the Console will be deleted.
- Script Window - This is where you can write R scripts and save them for future use. When you exit out of RStudio, if the script file (.R) has been saved, the code will not be deleted.
- Environment - This tab shows you all of the variables, datasets, or other items that you stored in RStudio during your session.
- History - This tab shows you a running list of all of the code you have run in RStudio previously, including previous sessions.
- Files - This tab shows your file managing system on your computer. This tab is very helpful when setting your working directory.
- Plots - This tab shows the plots you produce in RStudio. Here you can make them bigger or export them for further use.
- Packages - This tab shows a list of the packages (additional packages of code written by other people) you have installed on your computer. Using another analogy from Moderndive.com, packages can be compared to apps on a smartphone. You can still use the smartphone without other apps but if you want to check social media, order from DoorDash or play games, you have install and then open up apps. In R, you have to install and then load packages into your R session in order for you to use them.
- Help - This tab allows you to search for help regarding R and its various functions. If you need help regarding a specific function, type the question mark symbol, '?', followed by the name of the function and run it. The R help page for that function will show up in this Help pane (Example: ?mean). To get general R help, click the Home/House icon in the Help pane to show a page of R Help Resources.
RStudio Personalization
One final thing you can do to make coding in R more fun, you can customize the look of your RStudio to fit your preference!