
Biodiversity Distribution master class
Source:R/class-biodiversitydistribution.R
BiodiversityDistribution-class.RdBase R6 class for any biodiversity distribution objects.
Serves as container that supplies data and functions to other R6
classes. Generally stores all objects and parameters added to a model.
Details
Run names() on a distribution object to show all available
functions.
Public fields
backgroundA
SpatRasterorsfobject delineating the modelling extent.limitsAn optional
sfobject on potential extrapolation limitsbiodiversityA
BiodiversityDatasetCollectionobject.predictorsA
PredictorDatasetobject.priorsAn optional
PriorListobject.controlAn optional Control object such as for biases.
latentfactorsA
characteron whether latentfactors are used.offsetA
characteron whether methods are used.logAn optional
Logobject.engineA
Engineobject.
Methods
BiodiversityDistribution$new()
Initializes the object and creates an BiodiversityDataset by default.
Usage
BiodiversityDistribution$new(background, limits, biodiversity, ...)Arguments
backgroundA
SpatRasterorsfobject delineating the modelling extent.limitsAn optional
sfobject on potential extrapolation limitsbiodiversityA
BiodiversityDatasetCollectionobject....Any other objects
BiodiversityDistribution$show_background_info()
Summarizes extent and projection from set background
Returns
A character with the name
BiodiversityDistribution$set_limits()
Specify new limits to the background
Arguments
xA
listobject with method and limit type.
BiodiversityDistribution$get_limits()
Get provided limits if set or a waiver
Returns
A list or waiver.
BiodiversityDistribution$get_predictor_names()
Function for querying predictor names if existing
Returns
A character vector.
BiodiversityDistribution$get_latent()
Get latent factors if found in object.
Returns
A character with those objects.
BiodiversityDistribution$set_priors()
Specify new prior object. Overwrites existing ones
Arguments
xA
PriorListobject.
BiodiversityDistribution$set_biodiversity()
Adds a new biodiversity object to the existing empty collection.
Arguments
idA
characteror id defining this object.pA
BiodiversityDatasetobject.
BiodiversityDistribution$set_predictors()
Set a new Predictor object to this object.
Arguments
xA
PredictorDatasetwith predictors for this object.
BiodiversityDistribution$set_engine()
Set a new Engine object to this object.
Arguments
xA
Enginefor this object.
BiodiversityDistribution$get_engine()
Gets the name of the current engine if set.
Returns
A character with the engine name
BiodiversityDistribution$get_prior_variables()
Get prior variables
Returns
A character with the variable names for which priors have been added.
BiodiversityDistribution$set_offset()
Specify new offsets.
Arguments
xA new
SpatRasterobject to be used as offset.
BiodiversityDistribution$get_offset()
Get offset (print name)
Returns
A character with all the offsets in here.
BiodiversityDistribution$rm_offset()
Remove offsets if found.
Arguments
whatOptional
characterof specific offsets to remove.
BiodiversityDistribution$get_offset_type()
Get offset parameters if found
Returns
A list with the offset parameters if found.
BiodiversityDistribution$set_control()
Set new bias control
Arguments
typeA
characterwith the type of control object.xA new bias control object. Expecting a
SpatRasterobject.methodThe method used to create the object.
valueA vector of supplied values. For
"bias"those should benumeric.
BiodiversityDistribution$get_control()
Get bias control (print name)
Arguments
typeA
characterwith the type of control object.
Returns
A character with the control object if found.
BiodiversityDistribution$rm_control()
Remove bias controls if found.
Arguments
typeA
characterwith the type of control object.
BiodiversityDistribution$get_log()
Returns the output filename of the current log object if set.
Returns
A character where the output is returned.
BiodiversityDistribution$get_projection()
Get projection from the background in crs format.
Returns
A character of the projection
BiodiversityDistribution$get_resolution()
Return resolution of the background object.
Returns
A vector with the resolution.
BiodiversityDistribution$rm_predictors()
Remove predictiors. Either all of them or specific ones.
Arguments
namesA
characterwith the predictors to be removed.
BiodiversityDistribution$rm_priors()
Remove priors. Either all of them or specific ones.
Arguments
namesA
characterwith the priors to be removed.
BiodiversityDistribution$show_biodiversity_length()
Show number of biodiversity records
Returns
A numeric with sum of biodiversity records
BiodiversityDistribution$get_biodiversity_equations()
Get equations of biodiversity records
Returns
A list vector.
BiodiversityDistribution$get_biodiversity_types()
Query all biodiversity types in this object
Returns
A character vector.
BiodiversityDistribution$get_biodiversity_ids()
Return all biodiversity dataset ids in the object
Returns
A list for the ids in the biodiversity datasets
BiodiversityDistribution$get_biodiversity_names()
Return all the character names of all biodiversity datasets
Returns
A list with the names in the biodiversity datasets
Examples
# Query available functions and entries
background <- terra::rast(system.file('extdata/europegrid_50km.tif',
package='ibis.iSDM',mustWork = TRUE))
# Define model
x <- distribution(background)
#> [Setup] 2026-05-14 20:28:17.176897 | Creating distribution object...
names(x)
#> [1] ".__enclos_env__" "engine"
#> [3] "log" "offset"
#> [5] "latentfactors" "control"
#> [7] "priors" "predictors"
#> [9] "biodiversity" "limits"
#> [11] "background" "clone"
#> [13] "summary" "plot"
#> [15] "get_biodiversity_names" "get_biodiversity_ids"
#> [17] "get_biodiversity_types" "get_biodiversity_equations"
#> [19] "show_biodiversity_equations" "show_biodiversity_length"
#> [21] "rm_priors" "rm_predictors"
#> [23] "get_resolution" "get_projection"
#> [25] "get_extent" "set_log"
#> [27] "get_log" "plot_bias"
#> [29] "rm_control" "get_control"
#> [31] "set_control" "get_offset_type"
#> [33] "plot_offsets" "rm_offset"
#> [35] "get_offset" "set_offset"
#> [37] "get_prior_variables" "rm_engine"
#> [39] "get_engine" "set_engine"
#> [41] "set_predictors" "set_biodiversity"
#> [43] "set_priors" "get_priors"
#> [45] "rm_latent" "get_latent"
#> [47] "set_latent" "get_predictor_names"
#> [49] "rm_limits" "get_limits"
#> [51] "set_limits" "show_background_info"
#> [53] "name" "show"
#> [55] "print" "initialize"