Getting Started with R
- Install R (choose the link at the top for your operating system.
- If you click Windows, click “base” on the following page.
- If you click Mac OS X, click the first link under “Latest Release” (it will look like “R-3.5.0.pkg”)
- If you click Linux, you probably already have R installed on your system. If not, go through your Operating System’s package manager.
- Install RStudio (choose the link at the top for your operating system.)
- Open RStudio
- If you are on a Mac, you may be asked to install “Developer Tools.” Go ahead and click Ok. RStudio may later say that it is “Finding software,” or something similar. This may take a while, but will eventually finish.
- Once RStudio is open, click on the bottom left part of the screen, next to the “>” symbol. Paste the following, and then press Enter on your keyboard:
It will probably take several minutes (up to 10+ minutes) to install everything. You’ll know it’s finished once you see the “>” symbol at the bottom of the screen again.
- See this introduction to RStudio and this “cheat sheet” about RStudio’s interface from its authors
- Within RStudio, set some basic settings: go to Tools -> Global Options, then:
- Under Code -> Editing, check “Soft-wrap R source files”
- Under Code -> Display, check “Show line numbers”
- See the variety of other “cheat sheets” from the authors of RStudio
Other learning resources
- See the introduction to R’s syntax at Learn X in Y Minutes
Doing Statistical Analyses in R
- Explore the lessons published by the UCLA Institute for Digital Research and Education