This code calculates indicator E1 of NorInAliS.
Load the establishment categories from the Alien Species List 2018:
EstablishmentCategories2018 <- read.csv2("../cache/a-e.csv", as.is=T)
This file consists of the two columns “Name” and “CategN” of the sheet “List I” of the Excel workbook which is Online Resource 1 of Sandvik et al. (2019):
head(EstablishmentCategories2018)
## Name CategN
## 1 Abies alba E
## 2 Abies amabilis C2
## 3 Abies balsamea C3
## 4 Abies cephalonica C2
## 5 Abies concolor C3
## 6 Abies grandis C3
Define auxiliary functions:
# Combines text strings
"%+%" <- function(string1, string2) paste0(string1, string2)
# Calculates the union of two sets (vectors)
"%A%" <- function(set1, set2)
if (is.null(set1)) logical(0) else as.vector(na.omit(set1[set1 %in% set2]))
Define an indicator-specific function:
E1 <- function(List1, List2,
ID1 = "Name", ID2 = "Name",
EstCat1 = "CategN", EstCat2 = "CategN") {
# It is crucially important that the identifiers are identical in the two lists.
# Here, the species names are used as identifiers.
# However, species names may change due to taxonomic revision.
# Therefore, the use of unequivocal (e.g. numerical) species identifiers is
# to be preferred.
w1 <- which(List1[, EstCat1] %in% c("C2", "C3", "D1", "D2", "E"))
# species that are reproducing unaidedly at time 1
w2 <- which(List2[, EstCat2] == "A")
# species that are absent from the assessment area at time 2
eradicated <- List1[w1, ID1] %A% List2[w2, ID2]
# union of the two sets of identifiers
return(length(eradicated))
}
Indicator E1 presupposes that establishment categories according to Blackburn et al.’s (2011) “unified framework” are available for two consecutive Alien Species Lists. This information will be an integrative part of the coming Alien Species List (2023, in prep.). For the current Alien Species List (Artsdatabanken 2018), establishment categories were published by Sandvik et al. (2019). For the previous Alien Species List (Artsdatabanken 2012), this information is not available. This means that, currently, indicator E1 cannot be estimated automatically. A “manual” comparison between the Alien Species Lists 2012 and 2018 shows that no alien has been eradicated between 2012 and 2018. The following script shows how this test can be automatised, albeit as an illustration only.
Illustration of the function:
Since the establishment categories for the Alien Species List 2012 are not available, the actual result can be “simulated” as follows:
EstablishmentCategories2012 <- EstablishmentCategories2018
cat("Actual estimate for E1: " %+%
E1(EstablishmentCategories2012, EstablishmentCategories2018) %+% "\n")
## Actual estimate for E1: 0
Further illustration:
Just to illustrate the method, we may define a dummy dataset with shuffled establishment categories:
for (i in 1:9) {
DummyCategories <- EstablishmentCategories2018
DummyCategories[, "CategN"] <- sample(DummyCategories[, "CategN"])
cat("Randomised estimate for E1 (randomisation " %+% i %+% "): " %+%
E1(DummyCategories, EstablishmentCategories2018) %+% "\n")
}
## Randomised estimate for E1 (randomisation 1): 1
## Randomised estimate for E1 (randomisation 2): 1
## Randomised estimate for E1 (randomisation 3): 1
## Randomised estimate for E1 (randomisation 4): 1
## Randomised estimate for E1 (randomisation 5): 2
## Randomised estimate for E1 (randomisation 6): 1
## Randomised estimate for E1 (randomisation 7): 1
## Randomised estimate for E1 (randomisation 8): 2
## Randomised estimate for E1 (randomisation 9): 0