
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
Method 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
Method print()
Looks for and returns the properties of all contained objects.
Method show_background_info()
Summarizes extent and projection from set background
Returns
A character with the name
Method set_limits()
Specify new limits to the background
Arguments
xA
listobject with method and limit type.
Method rm_limits()
Remove limits if set.
Method get_predictor_names()
Function for querying predictor names if existing
Returns
A character vector.
Method rm_latent()
Remove latent factors if found in object.
Method get_priors()
Get prior object if found in object.
Method set_priors()
Specify new prior object. Overwrites existing ones
Arguments
xA
PriorListobject.
Method set_biodiversity()
Adds a new biodiversity object to the existing empty collection.
Arguments
idA
characteror id defining this object.pA
BiodiversityDatasetobject.
Method set_predictors()
Set a new Predictor object to this object.
Arguments
xA
PredictorDatasetwith predictors for this object.
Method get_engine()
Gets the name of the current engine if set.
Returns
A character with the engine name
Method get_prior_variables()
Get prior variables
Returns
A character with the variable names for which priors have been added.
Method rm_offset()
Remove offsets if found.
Arguments
whatOptional
characterof specific offsets to remove.
Method get_offset_type()
Get offset parameters if found
Returns
A list with the offset parameters if found.
Method get_control()
Get bias control (print name)
Arguments
typeA
characterwith the type of control object.
Returns
A character with the control object if found.
Method rm_control()
Remove bias controls if found.
Arguments
typeA
characterwith the type of control object.
Method get_log()
Returns the output filename of the current log object if set.
Returns
A character where the output is returned.
Method get_projection()
Get projection from the background in crs format.
Returns
A character of the projection
Method get_resolution()
Return resolution of the background object.
Returns
A vector with the resolution.
Method rm_predictors()
Remove predictiors. Either all of them or specific ones.
Arguments
namesA
characterwith the predictors to be removed.
Method rm_priors()
Remove priors. Either all of them or specific ones.
Arguments
namesA
characterwith the priors to be removed.
Method show_biodiversity_length()
Show number of biodiversity records
Returns
A numeric with sum of biodiversity records
Method get_biodiversity_types()
Query all biodiversity types in this object
Returns
A character vector.
Method get_biodiversity_ids()
Return all biodiversity dataset ids in the object
Returns
A list for the ids in the biodiversity datasets
Method get_biodiversity_names()
Return all the character names of all biodiversity datasets
Returns
A list with the names in the biodiversity datasets
Method plot()
Plots the content of this class.
Method summary()
Summary function for this object.
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] 2025-06-19 20:44:48.655659 | 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"