1 Setup a new project in RStudio

I recommend using RStudio throughout the entire module. If you have not already done so, please visit the RStudio website (http://rstudio.org/) and download and install RStudio for your operating system.

I also recommend setting up an RStudio project for the entire module and within the RStudio project separate R scripts for each session. To do so:

  • Open RStudio
  • Go to the tab “File” and select “New Project”
  • Select either “New Directory” if you haven’t set up a module folder yet, or select “Existing Directory” to point towards an existing folder. This directory will be the working folder for the course. Navigate to the path of the project folder on your machine (e.g. ’~Documents/Courses/EEC-MGC)
  • Name your project, e.g “EEC-MGC.Rproj”
  • Use your file explorer on your machine, find your project folder, and create four sub-folders: data, scripts, results, and figures
  • All R codes in the following practicals should be saved in separate R scripts and saved in your “scripts” folder

2 Installing geospatial packages on Mac

In this module, we will deal a lot with geospatial data. Nowadays, R offers a lot of GIS functionalities in different packages.

If you work on a Windows machine, then installing and using these packages should be straight forward. If you are working on a Mac, you will need to install the GDAL software first. Here are some instructions for doing so: