Description Usage Arguments Value References See Also Examples
Generate pseudo-absence and pseudo-presence points according the procedure described by Bhatt et al. (2013) using the parameters: na
, np
and mu
(specified by pars
) and extract covariate values into a dataframe for modelling.
Where n
is the number of occurrence points, na * n
pseudo-absence points and np * n
pseudo-presence points are generated at a maximum distance of mu
decimal degrees from the occurrence points occurrence
. The selection of pseudo-absence/presence points is spatially weighted based on the evidence consensus layer consensus
(with values ranging from -100 to 100). Pseudo-absence points are more likely to be selected from cells with low consensus values (and never from cells with consensus 100). Pseudo-presence points are more likely to be from cells with high consensus values, and never from cells with values below threshold
.
The covariate values for occurrence, pseudo-absence and pseudo-presence points are extracted from covariates
and combined into a dataframe ready for modelling. Covariate values for polygon records are extracted using extractAdmin
and summarized either by their mean or mode for continuous and discrete variables respectively. Discrete variables should by identified using the factors
argument which will also coerce the covariates into factors in the resulting dataframe. If points = TRUE
a list is returned containing the dataframe and the pseudo-presence and pseudo-absence points. If return_points = FALSE
only the dataframe is returned.
1 2 | extractBhatt(pars, occurrence, covariates, consensus, admin, threshold = -25,
factor = rep(FALSE, nlayers(covariates)), return_points = FALSE, ...)
|
pars |
Vector of length three giving parameters for selection of pseudo-presence and pseudo-absence points. The parameters are:
|
occurrence |
A |
covariates |
A |
consensus |
A |
admin |
A |
threshold |
A threshold evidence consensus value below which pseudo-presence points will not be selected. |
factor |
A logical vector stating whether each layer in |
return_points |
Whether to return a list containing the dataframe and |
... |
Additional arguments to pass to |
If return_points = TRUE
, a list with three elements:
data |
A dataframe with: column 1 giving 1s for occurrence and pseudo-presence records and 0s for pseudo-absence records; columns 2 and 3 giving the coordinates of these records; and the following columns containing the extracted covariates. |
pseudo_absence |
A |
pseudo_presence |
A |
Otherwise just data
.
Bhatt et al. (2013) The global distribution and burden of dengue. Nature http://www.nature.com/nature/journal/v496/n7446/full/nature12060.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | # load fake occurrence points, covariates and evidence consensus layer
data(occurrence)
data(covariates)
data(consensus)
data(admin)
# run checks, add GAUL codes and return a SpatialPoints object
occurrence <- checkOccurrence(occurrence, consensus, admin)
# run extractBhatt with:
# pseudo-absence ratio of 10:1
# pseudo-presence ratio of 0.1:1
# distance of 5 decimal degrees
# and specifying the last covariate as a discrete variable
lis <- extractBhatt(c(2, 1, 5),
occurrence,
covariates,
consensus,
admin,
return_points = TRUE,
factor = c(FALSE, FALSE, TRUE))
# look at what's produced
str(lis)
# specifically the dataframe
summary(lis$data)
# plot the true and pseudo points
# evidence consensus layer as a background
plot(consensus)
# add the pseudo-absences in light blue (note they aren't in high scoring
# consensus regions)
points(lis$pseudo_absence, pch = 16, col = 'light blue')
# and pseudo-presences in purple (not in the very low scoring regions)
points(lis$pseudo_presence, pch = 16, col = 'purple')
# and add the occurrence points
points(occurrence, pch = 16)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.