- The R Console “interprets” whatever you type
- Calculator
- Creating variables
- Applying functions
- “Analysis” Script + Interactive Exploration
- Static copy of what you did (reproducibility)
- Try things out interactively, then add to your script
RStudio is an Integrated Development Environment (IDE) for R
Easier working with R
More information
Super useful “cheat sheet”: https://github.com/rstudio/cheatsheets/raw/master/rstudio-ide.pdf
Let’s start by making an RStudio “Project”.
Go to File → New Project → New Directory → New Project
Call your Project “Intro_to_R”
If RStudio doesn’t look like this (or our RStudio), then do:
RStudio –> Preferences –> Pane Layout
In a .R file (we call a script), code is saved on your disk
History
Ctrl + Enter
(Cmd + Enter
on OS X) in your script evaluates that line of code
Ctrl+1
takes you to the script pageCtrl+2
takes you to the consoleThe View
command allows you to view data in a spreadsheet format. Run the following command:
View(mtcars)