Chapter 2 Preparing for the workshop
To prepare for this workshop, you must do the following steps:
Download the data required for this workshop:
Their data can also be retrieved from the ade4 package:
library(ade4)
data(doubs)
spe <- doubs$fish
env <- doubs$envAlternatively, from the codep package:
library(codep)
data(Doubs)
spe <- Doubs.fish
env <- Doubs.envDownload the script containing the coldiss() function:
You must also use these packages:
list.of.packages <- c("ape", "ade4", "codep", "gclus", "vegan",
"GGally", "PlaneGeometry", "remotes", "matlib", "MASS")
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,
"Package"])]
if (length(new.packages) > 0) {
install.packages(new.packages, dependencies = TRUE)
print(paste0("The following package was installed:", new.packages))
} else if (length(new.packages) == 0) {
print("All packages were already installed previously")
}## [1] "The following package was installed:ape"
## [2] "The following package was installed:ade4"
## [3] "The following package was installed:codep"
## [4] "The following package was installed:gclus"
## [5] "The following package was installed:vegan"
## [6] "The following package was installed:GGally"
## [7] "The following package was installed:PlaneGeometry"
## [8] "The following package was installed:remotes"
## [9] "The following package was installed:matlib"
# Load all required libraries at once
invisible(lapply(list.of.packages, library, character.only = TRUE,
quietly = TRUE))
# source(file.choose()) # use coldiss.R which you have
# downloaded to your own directory