Thanks for your interest in learning R. For the workshop, we will be using RStudio as our interface to R. In order to participate in this workshop you will need to make sure you have R and RStudio installed on your computer.
Thanks to the USGS-R Training group and Data Carpentry for making their installation materials available. The following instructions come directly from their materials, with a few minor edits to help you get all set up for the workshop.
R and RStudio are separate downloads and installations. R is the underlying statistical computing environment, but using R alone is no fun. RStudio is a graphical integrated development environment (IDE) that makes using R much easier and more interactive. You need to install R before you install RStudio.
Go to CRAN and download the R installer for Windows. Make sure to choose the latest stable version (v4.0.4 as of February 2021).
Once the installer downloads, Right-click on it and select “Run as administrator”.
Type in your credentials and click yes (or if you don’t have administrator access have your IT rep install with Admin privileges).
You can click next through the standard dialogs and accept most defaults. But at the destination screen, please verify that it is installing it to C:\Program Files\R
At the “Select Components” screen, you can accept the default and install both 32-bit and 64-bit versions.
At this screen, uncheck ‘Create a desktop icon’ because non-admin users in Windows will be unable to delete it.
Go to the RStudio download page and select the download that is appropriate for your operating system.
Double-click the installer. It will ask for your administrator credentials to install (you might need to have your IT rep install again).
Accept all the default options for the RStudio install.
Once installed, RStudio should be accessible from the start menu. Start up RStudio. Once running it should look something like:
By default the console window will be on the left side of RStudio. Find that window. It will looking something like:
Click in the window and paste in the code from below:
version$version.string
Ideally you should be running the latest stable release (v4.0.4
as of February 2021). An older version of R is fine, but you should have at least version 4.0 installed.
Here is what my R version looks like.
## [1] "R version 4.0.2 (2020-06-22)"
Install packages available for all R users from CRAN and GitHub by pasting the following code into RStudio and hitting ENTER
.
install.packages(c("tidyverse", "mapview", "remotes"))
remotes::install_github("tbep-tech/peptools")
If you see something like this:
That’s OK! There’s a dialog box hiding behind RStudio asking if you want to create a personal folder in your Documents folder. Click Yes. It will look something like this when done:
Download the zipped file of all the data from this link. Unzip the contents and place this folder at a location on your computer that you can access for the workshop.
Download the zipped file of all the R scripts used for each lesson from this link. Unzip the content into a folder on your computer that you can access for the workshop.