R and RStudio
R and RStudio
Resources
- This activity draws on Chapter 1 in Statistical Inference via Data Science: A ModernDive into R and the Tidyverse
What are R and RStudio?
- In the quantitative methods tutorial, we will use R and RStudio to illustrate basic statistical concepts
- R is a programming language and free computing environment for statistical computing and graphics
- RStudio is an integrated development environment (IDE) that provides an interface by adding many convenient features and tools
- Think of R as a car’s engine and RStudio as the dashboard
R is a programming language and free computing environment for statistical computing and graphics. It can be runs on a wide variety of operating systems, including Linux, Windows, and MacOS. RStudio is an integrated development environment (IDE) that provides an interface by adding many convenient features and tools.
You can think of R as a car’s engine and RStudio as the dashboard. In the same way that having access to a speedometer and a navigation system makes driving much easier, using RStudio’s interface makes using R much easier as well.
R and RStudio are entirely free and updated on a regular basis, making them much more accessible and widely used than paid alternatives. You can conduct nearly any analysis using R, ranging from calculating the average of a variable to creating maps and conducting spatial analysis to conducting the analysis for an impact evaluation.
Installing R
- Download and install R by going to https://cloud.r-project.org/
- Windows: Click on “Download R for Windows”, then click on “base”, then click on the Download link
- macOS user: Click on “Download R for macOS”, then under “Latest release:” click on R-X.X.X.pkg, where R-X.X.X is the version number
- Linux user: Click on “Download R for Linux” and choose your distribution for more information on installing R for your setup
If you don’t have R and RStudio already installed, that will be the first step. You will first need to download and install both R and RStudio (Desktop version) on your computer. It is important that you install R first and then install RStudio.
Installing RStudio
- Download and install RStudio at https://www.rstudio.com/products/rstudio/download/
- Scroll down to “Installers for Supported Platforms” near the bottom of the page
- Click on the download link corresponding to your computer’s operating system
Once you have installed R, you can now install RStudio.
Using R via RStudio
- Using R by opening RStudio
Using R via RStudio
- After you open RStudio, you should see something like this
Note the three panes which are three panels dividing the screen: the console pane, the files pane, and the environment pane. Over the course of this tutorial, you’ll come to learn what purpose each of these panes serves.
Peronalization
- Customize the appearance of your R IDE by going to Tools -> Global Options -> Appearance