Introduction to Using R
This document contains instructions for installing R and RStudio, the software used to run some of the code in this repository. R is a free, open source, programming language often used for data manipulation, analysis, and visualization. RStudio is a development environment that makes using R easier. You may need to work with your IT team to have these programs installed in a place that can access your data.
Installing R and RStudio
-
Install R: R is available from The Comprehensive R Archive Network (CRAN). Click the download button for your operating system (Linux, Mac, or Windows).
-
Install RStudio: You can download RStudio from the RStudio website. Select the RStudio Desktop Open Source option.
Using R and RStudio
In RStudio, you will see a panel labeled “Console”. You can type and run R commands here.

You can also run R commands that are stored in a file by opening the file (File -> Open File) and clicking “Run” in the upper right.

Installing additional packages
You may want to install aditional packages that can do a variety of tasks beyond what is available in base R. Packages for R are made available through CRAN. The R code in this repository includes instructions for installing the required packages. You can also browse available packages here. To install a package use the command install.packages. For example, to install dpylr, a popular package of data manipulation tools, type install.packages("dplyr).
Further information
The instructions above are designed to help you run the code available in this repository. There are many tutorials and guides available for R. We recommend the following:
-
An Introduction to R Free, online guide written by the makers of R.
-
Data Camp Introduction to R Course An online course in R for data analysis. The first sessions are free.
-
Hands-On Programming with R by Garrett Grolemund A book-format through introduction to R.