Computational Set-up

Here are instructions for how check your R installation and install packages needed for the workshop.

Check software versions

Open R and run this code to check what version of R your system is running:


If the version printed is not 4.0 or newer, please upgrade R.

This step is not required if you do not use RStudio. Open RStudio and run this code to check what version of RStudio is installed on your system:


If the version printed is not 1.4 or newer, please upgrade Rstudio.

Install workshop packages

Open R and run this script:

package_list <- c("dplyr", "tidyr", "purrr",       # for standard data manipulation
                  "ggplot2", "desplot",            # for plotting
                  "nlme", "lme4", "emmeans",       # for linear modelling
                  "SpATS",                         # for fitting splines
                  "sp", "spdep", "gstat", "spaMM", "sf")    # for spatial modelling

sapply(package_list, require, character.only = TRUE)
Please note that the spatial packages may take awhile to install, and you may run into problems with the installation. Please attempt installation in advance of the workshop. The packages have all been successfully installed if after the sapply(package_list, require, character.only = TRUE) is run, the R output is “TRUE” for each package. If you have problems installing and/or loading any of these packages that you are not able to resolve, contact us so we can help you, preferably before the workshop.

Library Information

package usage
dplyr, tidyr, standard data manipulation
purrr for repeat functions
nlme mixed linear models with options for spatial covariates
lme4 mixed linear models with crossed random effects
ggplot, desplot standard plotting packge and extension for plotting block outlines
SpATS spline-fitting
sp preparation of spatial objects
spdep Moran’s I test
gstat for fitting empirical variogram
spaMM fits Matern covariances structure for mixed linear models
emmeans extracts marginal means from linear model objects