1  Installation

Author

Jarad Niemi

This page will walk through the installation of

1.1 R

To install R,

This will bring up a list of CRAN Mirrors to choose from. I generally choose the location that is geographically closest to me in an attempt to obtain the fastest download speed. For me, that mirror is located at Iowa State University.

Now,

  • click on the link appropriate for your operating system and
  • follow the instructions.

During installation, select default settings.

After you have installed R, you are provided with the default graphical user interface called RGUI. Instead of using this interface, we will install RStudio Desktop.

1.2 RStudio

To install RStudio,

  • navigate to RStudio Desktop and
  • click on the Download RStudio Desktop link.

This link will have automatically detected your operating system. If your operating system was not correctly detected, scroll down to select the appropriate installer.

Follow the installation instructions to install the RStudio integrated development environment (IDE) and graphical user interface (GUI).

1.3 tidyverse

At this point, you have installed the statistical software R and the graphical user interface RStudio. R has a lot of capabilities, but even more capabilities can be added through R packages. We will discuss R packages more in the future. For now, we just want to install the tidyverse, a collection of R packages designed for data science.

To install the tidyverse, run the following in the console

install.packages("tidyverse")

To verify the installation has proceded correctly, by running the following command

library("tidyverse")
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.2     ✔ readr     2.1.4
✔ forcats   1.0.0     ✔ stringr   1.5.0
✔ ggplot2   3.4.2     ✔ tibble    3.2.1
✔ lubridate 1.9.2     ✔ tidyr     1.3.0
✔ purrr     1.0.1     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors

If this command does not produce an Error (which would say Error and show up in red), you have successfully installed the tidyverse.

1.4 Troubleshooting

While the vast majority of installations work flawlessly, problems may arise for some. Typically a quick internet search for the problem will lead to a solution. If this doesn’t work, please post a question on the course Discussion board.