Chapter 2 Preparing for the workshop

All workshop materials are found at github.com/QCBSRworkshops/workshop10. This includes an R script which contains all code chunks shown in this book.

For this workshop, we will be working with the following datasets:

To download this data, do right click + save on the page that opens.

You should also make sure you have downloaded, installed, and loaded these packages:

  • vegan (for multivariate analyses)
  • labdsv (for identification of significant indicator species in the multivariate regression tree analysis)
  • MASS (for linear discriminant analysis)
  • mvpart* (for multivariate regression trees)
  • ggplot2 (for plotting some results)
# Install the required packages
install.packages("vegan")
install.packages("labdsv")
install.packages("MASS")
install.packages("ggplot2")

# install mvpart from package archive file
install.packages("remotes")
remotes::install_url("https://cran.r-project.org/src/contrib/Archive/mvpart/mvpart_1.6-2.tar.gz")

*The mvpart package is no longer hosted on CRAN, but is still available from the archives. To install mvpart, you can also download the .tar.gz version from here and go to the “Packages” tab on the bottom right panel of R Studio, and click on “Install Packages”. Choose to install from Package Archive file, and select the .tar.gz for mvpart.

# Load the required packages
library(labdsv)
library(vegan)
library(MASS)
library(mvpart)
library(ggplot2)