spatiotemp_bias {dynamicSDM}  R Documentation 
Test for spatial and temporal bias in species occurrence records
Description
Generates plots for visual assessment of spatial and temporal biases in occurrence records. Tests whether the spatiotemporal distribution of records is significantly different from the distribution from random sampling.
Usage
spatiotemp_bias(
occ.data,
temporal.level,
plot = FALSE,
spatial.method = "simple",
centroid,
radius,
prj = "+proj=longlat +datum=WGS84"
)
Arguments
occ.data 
a data frame, with columns for occurrence record coordinates and dates with column names as follows; record longitude as "x", latitude as "y", year as "year", month as "month", and day as "day". 
temporal.level 
a character string or vector, the time step(s) to test for temporal bias at.
One or multiple of 
plot 
a logical indicating whether to generate plots of spatial and temporal bias. See
details for plot descriptions. Default = 
spatial.method 
a character string, the method to calculate the spatial bias statistic. One
of; 
centroid 
a numeric vector of length two, specifying the centroid coordinates in the order
of longitude then latitude. Only required if 
radius 
a numeric value, the radial distance in metres from the given centroid coordinate
to measure spatial bias within. Only required if 
prj 
a character string, the coordinate reference system of occ.data coordinates. Default is "+proj=longlat +datum=WGS84". 
Value
Returns list containing chisquared and ttest results, and plots if specified.
Temporal bias
To assess temporal sampling bias, the function returns a histogram plot
of the frequency distribution of records across the given time step specified by temporal.level
(if plot = TRUE
). The observed frequency of sampling across the categorical time steps are
compared to the distribution expected from random sampling, using a chisquared test (Greenwood
and Nikulin, 1996) .
Spatial bias
To assess spatial sampling bias, the function returns a scatter plot of the spatial
distribution of occurrence records to illustrate any spatial clustering (if plot = TRUE
). The
average nearest neighbour distance of record coordinates is then compared to that of records
randomly generated at same density using a ttest, following the nearest neighbour index
established by Clark and Evans (1954).
Bias: methods
Below we outline the methods for which these tests for biases can be applied. dynamicSDM
offers
the additional functionality of the core
approach. This enables users to explore sampling biases
in set areas of a species range. This may be valuable if peripherycore relationships could lead
to inaccurate inferences of sampling bias. For instance, if species are expanding or shifting
their ranges through space and time.
#'

simple
 generates the random points within a rectangle created using the minimum and maximum longitude and latitude of occurrence coordinates. 
convex_hull
 generates the random points within the convex hull of occurrence record coordinates (i.e. the smallest convex set that contains all records). 
core
 generates the random points within specified circular area generated from a centroid point and radius. If these arguments (centroid
andradius
) are not provided thencentroid
is calculated by averaging coordinates of all occurrence records, andradius
is the mean distance away of all records from the centroid.
For each method, only occurrence records within the specified area are tested for spatial and temporal sampling biases.
Computation time
As the spatial bias test involves the calculation of a distance matrix. To reduce computation time, it is recommended that only a representative sample of large occurrence datasets are input.
References
Clark, P. J. & Evans, F. C. J. E. 1954. Distance To Nearest Neighbor As A Measure Of Spatial Relationships In Populations. 35, 445453.
Greenwood, P. E. & Nikulin, M. S. 1996. A Guide To ChiSquared Testing, John Wiley & Sons.
Examples
data(sample_explan_data)
bias_simple < spatiotemp_bias(
occ.data = sample_explan_data,
temporal.level = c("year"),
spatial.method = "simple",
plot = FALSE
)