Software installation

This course primarily uses the R data science programming language. We briefly touch upon QGIS to give you a basic foundation in the range of spatial software available, please follow the instructions below before the first practical session to install the software on your local computer if you are planning to use it throughout the course.

QGIS

QGIS is an open-source graphic user interface GIS with many community developed add on packages that (or plugins) that provide additional functionality to the software.

To get QGIS on your personal machine go to: https://qgis.org/en/site/forusers/download.html

I install the OSGeo4W version. The nature of open-source means that several programs will rely on each other for features. OSGeo4W tracks all the shared requirements and does not install any duplicates.

When you click through the dialogue boxes you need to search for QGIS in the OSGeo4W setup and click the refresh button so it changes from skip to install….

Continuous and discrete data. Source: [GIS Stackexchange](https://gis.stackexchange.com/questions/230672/how-to-install-osgeo4w-libraries-in-older-version-of-qgis-2-16)

Figure 0.1: Continuous and discrete data. Source: GIS Stackexchange

R

R is both a programming language and software environment, originally designed for statistical computing and graphics. R’s great strength is that it is open-source, can be used on any computer operating system and free for anyone to use and contribute to. Because of this, it is rapidly becoming the statistical language of choice for many academics and has a huge user community with people constantly contributing new packages to carry out all manner of statistical, graphical and importantly for us, geographical tasks.

R Java

Some R packages require you to download Java - it’s just an extra bit of software you can get from the Java website. Select the offline version.

Basics

The advised method for using R is to download it to your personal machine, so you can use it in future without any issues.

To use “R” we need to bits of software:

R is the core software and RStudio gives a simpler interface for us to use it. If you used R (which you could) you’d be just typing code, with no other features. RStudio gives us other features to make this much easier, just like how you would never type a report in notepad (Windows) or notes (on Apple), you’d use the word processor to make it easier. Chester Ismay and Albert Y. Kim explain this with a car analogy:

R and RStudio are software that require updating over time. It’s easy to forget!

Packages

Base R (controlled or driven through RStudio) is very limited. As a result people develop packages to make data loading, wrangling, analysis and visulisation much easier than having to write all the code. All packages will have lots of functions that just look up code from the package to make what you are doing easier (we will go into this in more detail later).

Packages develop over time and have different versions (like software). This can cause some issues with updates and code not working like it did once before. This book means i have to run all the code anyway, so every year it is checked and most packages are updated.

There are many errors and issues that can arise with package installation. You should read the following section now so you are aware of it, but you won’t need it until you hit an issue.

The most common package errors and issues are:

  • The package relies on another package which you might not have — this is called a dependency. Think about building a house — moving in and living in the house is dependent on the foundations, the walls, the windows. The solution is to install the package you are missing.

  • The package has a new version — simply update it, in RStudio the package tab (which we will see in the module) has an update option.

  • Your version of R might not support the package. This is unlikely as I update this every year. But to solve it either use an older version of the package and/or update your version of R.

  • There is an error with the package. If all else fails i remove the package and the re-install it. Again, in the package tab there is a small cross next to each package, clicking it let’s you remove it.

If the problem persists then assuming the error is package xxx is not available consult the relevant stack overflow question

Macs

We (Andy and Adam) use windows machines and whilst R runs across all operating systems, Mac users often need to install some extra software and packages, but this will be apparent during the module. As the Mac operating system updates new issues do appear which we will address in the module, Twitter or slack.

However don’t do this until you get the error and if you get stuck then contact us via Twitter or Slack.

You will likely need the package rgdal as the package sf, which we use extensively, is dependent on it. rgdal needs the gdal library to be installed on the computer (not as an R package), and it usually isn’t installed on Macs.

To install it, follow the stack overflow guide

Mac users may need to install Java (which might involve removing the existing version) this is covered in the [Mac R issues] section.

ArcGIS

As ArcGIS is not open source and from my experience analysis within it is largely not reproducible and therefore it is not included within this practical book. If you are interested in it please consult previous iterations of this course. You will find tutorials on: Joining data, Map Making and Spatial Patterns.