Installation

Before you start the installation of R, make sure your computer software is up-to-date. To get the most out of R, it is usually best to update to the maximum possible operating system.

On a Mac, under the  you can find About This Mac. Then, in the Overview Tab you can find Software Update… and follow the instructions.

R

Download and install R. Follow the link below and choose the appropriate version.

Link: R

RStudio

Download and install RStudio. RStudio is an interface which facilitates coding in R. We recommend RStudio Desktop.

Link: RStudio

R Markdown

Download and install R Markdown. R Markdown is an authoring framework in which you can combine your code and your comments into a report.

When you have finished installing R and RStudio you can install R Markdown. Open RStudio. (Note: R and RStudio are different apps. You should use RStudio. You might have to search for the app to find it.). When you have opened RStudio you should go to the Console (the lower left window in RStudio). Then type the following line, and run it by pressing Enter.

install.packages("rmarkdown")

LaTeX

Download and install LaTeX. LaTeX is a typesetting system which helps you write mathematical formulas and other technical documents. It is also needed to convert your report into a PDF.

You might already have a LaTeX distribution installed on your computer. If not, we recommend you install TinyTeX, which is a compact version of LaTeX. To install TinyTeX, go to the Console in RStudio and type the following line, and run it by pressing Enter.

install.packages("tinytex")

The above code merely downloads an installer to your computer. Now, to use the installer, type the following line (also in the Console), and run it by pressing Enter.

tinytex::install_tinytex()

Need more help? Please visit our video channel on Kaltura/SSE Play, or e-mail us:

For mac:

For PC:

Packages

Besides the above components, you will also need some more packages. The Read Excel package allows you to import Excel spreadsheet data into R. The kableExtra package allows you to add styles to tables. The GG Plot2 package allows you to make more advanced graphics. To install the needed packages, run the following code, line by line, in the Console.

install.packages("readxl")
install.packages("kableExtra")
install.packages("ggplot2")
install.packages("tibble")
install.packages("dplyr")
install.packages("tidyr")
install.packages("RColorBrewer")