
Add biodiversity polygon dataset to a distribution object (presence-only)
Source:R/add_biodiversity.R
add_biodiversity_polpo.RdThis function can be used to add a sf polygon dataset to an
existing distribution object. Presence-only polygon data is treated
differential than point data in some engines particular through the way that
points are generated.
Usage
add_biodiversity_polpo(
x,
polpo,
name = NULL,
field_occurrence = "observed",
formula = NULL,
family = "poisson",
link = NULL,
weight = 1,
simulate = FALSE,
simulate_points = 100,
simulate_bias = NULL,
simulate_strategy = "random",
separate_intercept = TRUE,
docheck = TRUE,
pseudoabsence_settings = NULL,
...
)
# S4 method for class 'BiodiversityDistribution,sf'
add_biodiversity_polpo(
x,
polpo,
name = NULL,
field_occurrence = "observed",
formula = NULL,
family = "poisson",
link = NULL,
weight = 1,
simulate = FALSE,
simulate_points = 100,
simulate_bias = NULL,
simulate_strategy = "random",
separate_intercept = TRUE,
docheck = TRUE,
pseudoabsence_settings = NULL,
...
)Arguments
- x
distribution()(i.e.BiodiversityDistribution) object.- polpo
A
sfpolygon object of presence-only occurrences.- name
The name of the biodiversity dataset used as internal identifier.
- field_occurrence
A
numericorcharacterlocation of biodiversity point records.- formula
A
characterorformulaobject to be passed. Default is to use all covariates (if specified).- family
A
characterstating the family to be used (Default:poisson).- link
A
characterto overwrite the default link function (Default:NULL).- weight
A
numericvalue acting as a multiplier with regards to any weights used in the modelling. Larger weights indicate higher weighting relative to any other datasets. By default set to1if only one dataset is added. Avectoris also supported but must be of the same length as"polpo".- simulate
Simulate poipo points within its boundaries. Result are passed to
add_biodiversity_poipo(Default:FALSE).- simulate_points
A
numericnumber of points to be created by simulation (Default:100).- simulate_bias
A
SpatRasterlayer describing an eventual preference for simulation (Default:NULL).- simulate_strategy
A
characterstating the strategy for sampling. Can be set to either.'random'or'regular', the latter requiring a raster supplied in the'simulate_weights'parameter.- separate_intercept
A
logicalvalue stating whether a separate intercept is to be added in shared likelihood models for engines engine_inla, engine_inlabru and engine_stan.- docheck
logicalon whether additional checks should be performed (e.g. intersection tests) (Default:TRUE).- pseudoabsence_settings
Either
NULLor apseudoabs_settings()created settings object.- ...
Other parameters passed down.
Value
Adds biodiversity data to distribution object.
Details
The default approach for polygon data is to sample presence-only
points across the region of the polygons. This function thus adds as a
wrapper to add_biodiversity_poipo() as presence-only points are created
by the model. If no points are simulated directly (Default) then the
polygon is processed by train() by creating regular point data over the
supplied predictors.
Use add_biodiversity_polpa() to create binomial distributed
inside-outside points for the given polygon!
For an integration of range data as predictor or offset, see
add_predictor_range() and add_offset_range() instead.
See also
Other add_biodiversity:
add_biodiversity_poipa(),
add_biodiversity_poipo(),
add_biodiversity_polpa()
Examples
if (FALSE) { # \dontrun{
x <- distribution(mod) |>
add_biodiversity_polpo(protectedArea)
} # }