Biodiversity Distribution master class
Source:R/class-biodiversitydistribution.R
BiodiversityDistribution-class.Rd
Base 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
background
A
SpatRaster
orsf
object delineating the modelling extent.limits
An optional
sf
object on potential extrapolation limitsbiodiversity
A
BiodiversityDatasetCollection
object.predictors
A
PredictorDataset
object.priors
An optional
PriorList
object.control
An optional Control object.
latentfactors
A
character
on whether latentfactors are used.offset
A
character
on whether methods are used.log
An optional
Log
object.engine
A
Engine
object.
Methods
Method new()
Initializes the object and creates an BiodiversityDataset by default.
Usage
BiodiversityDistribution$new(background, limits, biodiversity, ...)
Arguments
background
A
SpatRaster
orsf
object delineating the modelling extent.limits
An optional
sf
object on potential extrapolation limitsbiodiversity
A
BiodiversityDatasetCollection
object....
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
x
A
list
object 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
x
A
PriorList
object.
Method set_biodiversity()
Adds a new biodiversity object to the existing empty collection.
Arguments
id
A
character
or id defining this object.p
A
BiodiversityDataset
object.
Method set_predictors()
Set a new Predictor object to this object.
Arguments
x
A
PredictorDataset
with 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
what
Optional
character
of 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
type
A
character
with the type of control object.
Returns
A character
with the bias object if found.
Method rm_control()
Remove bias controls if found.
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
names
A
character
with the predictors to be removed.
Method rm_priors()
Remove priors. Either all of them or specific ones.
Arguments
names
A
character
with 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] 2024-11-19 13:21:13.524439 | 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"