Install R

R is supported by the great majority of operating systems:

  • If you are running Windows, you can go to the project website, and download R by pressing “Download R 3.x.y for Windows” (where 3.x.y is the current stable version — as I type this x = 4 and y = 1).
  • If you are running Mac, you can find binaries on the dedicated page.
  • If you are running Linux, it is best using your package manager to install R. The packages to install would be r-base and r-base-dev for those using Ubuntu or derivatives.

Install RStudio

While R designate the programing language itself, it is often useful to have an integrated piece of software to write and execute your R scripts. A particularly nice one is RStudio.

There are other alternatives, but let’s face it. RStudio rocks.

Find the binaries for your platform on the RStudio website.

Install R packages needed for this course

R packages are essentially extensions that gives “vanilla” R new capabilities.

There are 2 ways to install packages in RStudio, but it is actually easier to do it through the “Console” interface in RStudio. In the following figure, it’s the left hand panel:

The RStudio interface

The RStudio interface

You can install the packages needed for this course by using the install.packages function in that console. Simply copy and paste the following lines, and hit the Enter key:

install.packages(
  c(
    "sf",
    "rgdal",
    "sp",
    "gstat",
    "raster",
    "mapview",
    "aqp",
    "GSIF",
    "igraph",
    "devtools",
    "caret",
    "randomForest",
    "gbm",
    "Cubist",
    "plyr",
    "reshape2",
    "tidyverse",
    "ggplot2",
    "ggthemes",
    "hrbrthemes",
    "plotly",
    "knitr"
  )
)

Here I copied those instructions Once you hit Enter, the installation begins

Follow the instructions in this video if you need help.

There is one additional package that will need to be installed separatedly:

devtools::install_bitbucket("brendo1001/ithir/pkg")

You should find yourselves with the following:

This is what success looks like!

This is what success looks like!

Reading list for beginners

During the course, we will have a quick look at the RStudio interface, and learn the basics for data analysis in R. That said, if you are a first timer, we can recommend reading the following material prior to the course: