Throughout the quarter, we will be using R and RStudio for assignments. Before section on 01/09, you must be able to open up RStudio and run a few basic commands. This will leave more time during section to cover substantive material. Before section on 01/09, make sure that you are able to at least execute the commands in the Your First R Commands section of this document. Please see a TA during office hours if you are unable to execute these commands.

Why R?

R is an incredibly popular programming language for data analysis; used by statisticians but also by scientists in biology, psychology, economics, chemistry, etc. R is fully featured and very powerful, and unlike Stata or SaaS, it is free and open source. This means that you can continue to use it for free after you finish this class, and beyond. Additionally, R is extensible. When a statistician develops a new method, or when a scientist decides that they need a specific tool to analyze their specific data, they (or someone who wants to use it in R) will often implement the method as a collection of functions in R called a package. Other individuals who want to use the method or conduct a similar type of data analysis can download the package and use these functions without needing to rewrite all of the code themselves. The Comprehensive R Archive Network, or CRAN, contains over 13,000 contributed packages.

Downloading R and RStudio

If you have used R and RStudio for another course in the past, please still follow all instructions to ensure that you have download the most recent versions.

The programming language itself is called R, and RStudio is a user friendly interface for working with R. To download each tool, use the following links. Download the most recent version of R (version 3.6.2) and download the free version of RStudio Desktop.

For both R and RStudio, you must follow the instructions that are appropriate for your operating system (if you have a Mac, pick the Mac version. Likewise for windows).

Getting Started

Once you have both pieces of software downloaded, open up RStudio (as you would open any application). Make sure you open RStudio and not R. You should see a screen with three panels. If you are unable to open RStudio and see this screen, please scroll down to the Help, Iā€™m Stuck section of this document.