spatiotemp_check {dynamicSDM} | R Documentation |
Check species occurrence record formatting, completeness and validity.
Description
Checks the occurrence record data frame contains the column names and classes required for dynamicSDM functions. Option to exclude records containing missing, duplicate or invalid co-ordinates or dates.
Usage
spatiotemp_check(
occ.data,
na.handle,
duplicate.handle,
coord.handle,
date.handle,
date.res,
coordclean = FALSE,
coordclean.species = "species_1",
coordclean.handle = "exclude",
...
)
Arguments
occ.data |
a data frame, with columns for occurrence record co-ordinates and dates with column names as follows; record longitude as "x", latitude as "y", year as "year", month as "month", and day as "day". |
na.handle |
a character string, method for handling missing data (NA values) in record
co-ordinates and dates. One of |
duplicate.handle |
a character string, method for handling duplicate record co-ordinates or
dates. One of |
coord.handle |
a character string, method for handling invalid co-ordinates in record data.
One of |
date.handle |
a character string, method for handling invalid dates in record data. One of
|
date.res |
a character string, stating the temporal resolution to complete checks on. One of
|
coordclean |
a logical indicating whether to run function
|
coordclean.species |
a character string or vector, specifying the name of the species that
all of |
coordclean.handle |
a character string, method for handling records flagged by
|
... |
Other arguments passed onto |
Value
By default, returns occurrence record data frame, filtered to exclude records containing missing, duplicate or invalid data in record co-ordinates and dates.
date.res
argument
The date.res
states the temporal resolution to check dates, including when searching for
duplicate records, removing records with NA values and checking for invalid dates.
Validity checks
Record dates and co-ordinates are checked for validity using the following rules:
Dates must be real dates that could exist. For example, 50th February 2000 is not a valid date.
Co-ordinates must have longitude (x) values between -180 and 180, and latitude (y) values between -90 and 90 to be considered valid.
CoordinateCleaner
compatibility
spatiotemp_check()
acts as a helper function for compatibility with the R package
CoordinateCleaner
(Zizka et al., 2019), which offers a diversity of functions for checking the
co-ordinates of occurrence records.
If coordclean
= TRUE, then coordclean.species
must be provided to identify which species each
record belonds to. If coordclean.handle
= exclude
then all occ.data
records flagged by
CoordinateCleaner::clean_coordinates()
as potentially erroneous are removed in the returned
data.
If coordclean.handle
= report
, then the occurrence data frame is returned with an additional
CC_REPORT
column. This column contains the output from
CoordinateCleaner::clean_coordinates()
which indicates the potentially erroneous records.
References
Zizka A, Silvestro D, Andermann T, Azevedo J, Duarte Ritter C, Edler D, Farooq H, Herdean A, Ariza M, Scharn R, Svanteson S, Wengstrom N, Zizka V, Antonelli A (2019). “CoordinateCleaner: standardized cleaning of occurrence records from biological collection databases.” Methods in Ecology and Evolution, -7. doi:10.1111/2041-210X.13152, R package version 2.0-20, https://github.com/ropensci/CoordinateCleaner.
Examples
data(sample_occ_data)
sample_occ_data<-convert_gbif(sample_occ_data)
nrow(sample_occ_data)
filtered<-spatiotemp_check(
occ.data = sample_occ_data,
coord.handle = "exclude",
date.handle = "exclude",
duplicate.handle = "exclude",
na.handle = "exclude"
)
nrow(filtered)
filtered_CC<-spatiotemp_check(
occ.data = sample_occ_data,
coord.handle = "exclude",
date.handle = "exclude",
duplicate.handle = "exclude",
na.handle = "exclude",
coordclean = TRUE,
coordclean.species = "quelea",
coordclean.handle = "exclude"
)
nrow(filtered_CC)