+
Count data
+
Count data requires two fields to be selected: the survey identifier
(document_id
) and the measure of abundance
(abundance_interpreted
).
-
select <- c("document_id", abundance = "abundance_interpreted")
+
+select <- c("document_id", abundance = "abundance_interpreted")
The count data requires the same filters as the survey data (though
the filter has_value
needs to be redefined).
-
filter[["has_value"]] <- select
+
+filter[["has_value"]] <- select
A set of taxa and their species temperature index values is
defined.
-
sti <- c(
- "Poecile montanus" = -7.51,
- "Regulus regulus" = -4.23,
- "Lophophanes cristatus" = -5.90,
- "Certhia familiaris" = -6.89
-)
+
+sti <- c(
+ "Poecile montanus" = -7.51,
+ "Regulus regulus" = -4.23,
+ "Lophophanes cristatus" = -5.90,
+ "Certhia familiaris" = -6.89
+)
The count data for these taxa can now be downloaded from FinBIF.
-
counts <- lapply(
- names(sti),
- finbif_occurrence,
- filter = filter,
- select = select,
- n = "all",
- quiet = TRUE
-)
+
+counts <- lapply(
+ names(sti),
+ finbif_occurrence,
+ filter = filter,
+ select = select,
+ n = "all",
+ quiet = TRUE
+)
The count data is then combined with the survey data and the species
temperature indices.
-
counts <- lapply(counts, combine_with_surveys, surveys)
-
-counts <- mapply(mutate, counts, sp = names(sti), SIMPLIFY = FALSE)
-
-counts <- do.call(rbind, counts)
-
-counts[["sti"]] <- sti[counts[["sp"]]]
+
+counts <- lapply(counts, combine_with_surveys, surveys)
+
+counts <- mapply(mutate, counts, sp = names(sti), SIMPLIFY = FALSE)
+
+counts <- do.call(rbind, counts)
+
+counts[["sti"]] <- sti[counts[["sp"]]]