Skip to contents

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.

Note

Not implemented yet.

Not implemented yet.

Public fields

background

A SpatRaster or sf object delineating the modelling extent.

limits

An optional sf object on potential extrapolation limits

biodiversity

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

Public methods


Method new()

Initializes the object and creates an BiodiversityDataset by default.

Usage

BiodiversityDistribution$new(background, limits, biodiversity, ...)

Arguments

background

A SpatRaster or sf object delineating the modelling extent.

limits

An optional sf object on potential extrapolation limits

biodiversity

A BiodiversityDatasetCollection object.

...

Any other objects

Returns

NULL


Method print()

Looks for and returns the properties of all contained objects.

Usage

BiodiversityDistribution$print()

Returns

A message on screen


Method show()

An alias for print

Usage

BiodiversityDistribution$show()

Returns

A message on screen


Method name()

Returns self-describing name

Usage

BiodiversityDistribution$name()

Returns

A character with the name


Method show_background_info()

Summarizes extent and projection from set background

Usage

BiodiversityDistribution$show_background_info()

Returns

A character with the name


Method set_limits()

Specify new limits to the background

Usage

BiodiversityDistribution$set_limits(x)

Arguments

x

A list object with method and limit type.

Returns

This object.


Method get_limits()

Get provided limits if set or a waiver

Usage

BiodiversityDistribution$get_limits()

Returns

A list or waiver.


Method rm_limits()

Remove limits if set.

Usage

BiodiversityDistribution$rm_limits()

Returns

This object.


Method get_predictor_names()

Function for querying predictor names if existing

Usage

BiodiversityDistribution$get_predictor_names()

Returns

A character vector.


Method set_latent()

Adding latent factors to the object.

Usage

BiodiversityDistribution$set_latent(type, method = NULL, separate_spde = FALSE)

Arguments

type

A character with the given type.

method

A character with a method.

separate_spde

A logical flag whether duplicate of SPDE effects are to be created.

Returns

This object.


Method get_latent()

Get latent factors if found in object.

Usage

BiodiversityDistribution$get_latent()

Returns

A character with those objects.


Method rm_latent()

Remove latent factors if found in object.

Usage

BiodiversityDistribution$rm_latent()

Returns

This object.


Method get_priors()

Get prior object if found in object.

Usage

BiodiversityDistribution$get_priors()

Returns

This object.


Method set_priors()

Specify new prior object. Overwrites existing ones

Usage

BiodiversityDistribution$set_priors(x)

Arguments

x

A PriorList object.

Returns

This object.


Method set_biodiversity()

Adds a new biodiversity object to the existing empty collection.

Usage

BiodiversityDistribution$set_biodiversity(id, p)

Arguments

id

A character or id defining this object.

p

A BiodiversityDataset object.

Returns

This object.


Method set_predictors()

Set a new Predictor object to this object.

Usage

BiodiversityDistribution$set_predictors(x)

Arguments

x

A PredictorDataset with predictors for this object.

Returns

This object.


Method set_engine()

Set a new Engine object to this object.

Usage

BiodiversityDistribution$set_engine(x)

Arguments

x

A Engine for this object.

Returns

This object.


Method get_engine()

Gets the name of the current engine if set.

Usage

BiodiversityDistribution$get_engine()

Returns

A character with the engine name


Method rm_engine()

Removes the current engine if set.

Usage

BiodiversityDistribution$rm_engine()

Returns

This object


Method get_prior_variables()

Get prior variables

Usage

BiodiversityDistribution$get_prior_variables()

Returns

A character with the variable names for which priors have been added.


Method set_offset()

Specify new offsets.

Usage

BiodiversityDistribution$set_offset(x)

Arguments

x

A new SpatRaster object to be used as offset.

Returns

This object.


Method get_offset()

Get offset (print name)

Usage

BiodiversityDistribution$get_offset()

Returns

A character with all the offsets in here.


Method rm_offset()

Remove offsets if found.

Usage

BiodiversityDistribution$rm_offset(what = NULL)

Arguments

what

Optional character of specific offsets to remove.

Returns

This object.


Method plot_offsets()

Plot offset if found.

Usage

BiodiversityDistribution$plot_offsets()

Returns

A graphical element.


Method get_offset_type()

Get offset parameters if found

Usage

BiodiversityDistribution$get_offset_type()

Returns

A list with the offset parameters if found.


Method set_control()

Set new bias control

Usage

BiodiversityDistribution$set_control(type = "bias", x, method, value)

Arguments

type

A character with the type of control object.

x

A new bias control object. Expecting a SpatRaster object.

method

The method used to create the object.

value

A bias value as numeric.

Returns

This object.


Method get_control()

Get bias control (print name)

Usage

BiodiversityDistribution$get_control(type = "bias")

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.

Usage

BiodiversityDistribution$rm_control()

Returns

This object.


Method plot_bias()

Plot bias variable if set.

Usage

BiodiversityDistribution$plot_bias()

Returns

A graphical element.


Method get_log()

Returns the output filename of the current log object if set.

Usage

BiodiversityDistribution$get_log()

Returns

A character where the output is returned.


Method set_log()

Set a new log object

Usage

BiodiversityDistribution$set_log(x)

Arguments

x

A Log object.

Returns

This object


Method get_extent()

Get extent

Usage

BiodiversityDistribution$get_extent()

Returns

Background extent or NULL.


Method get_projection()

Get projection from the background in crs format.

Usage

BiodiversityDistribution$get_projection()

Returns

A character of the projection


Method get_resolution()

Return resolution of the background object.

Usage

BiodiversityDistribution$get_resolution()

Returns

A vector with the resolution.


Method rm_predictors()

Remove predictiors. Either all of them or specific ones.

Usage

BiodiversityDistribution$rm_predictors(names)

Arguments

names

A character with the predictors to be removed.

Returns

This object.


Method rm_priors()

Remove priors. Either all of them or specific ones.

Usage

BiodiversityDistribution$rm_priors(names = NULL)

Arguments

names

A character with the priors to be removed.

Returns

This object.


Method show_biodiversity_length()

Show number of biodiversity records

Usage

BiodiversityDistribution$show_biodiversity_length()

Returns

A numeric with sum of biodiversity records


Method show_biodiversity_equations()

Show Equations of biodiversity records

Usage

BiodiversityDistribution$show_biodiversity_equations()

Returns

A message on screen.


Method get_biodiversity_equations()

Get equations of biodiversity records

Usage

BiodiversityDistribution$get_biodiversity_equations()

Returns

A list vector.


Method get_biodiversity_types()

Query all biodiversity types in this object

Usage

BiodiversityDistribution$get_biodiversity_types()

Returns

A character vector.


Method get_biodiversity_ids()

Return all biodiversity dataset ids in the object

Usage

BiodiversityDistribution$get_biodiversity_ids()

Returns

A list for the ids in the biodiversity datasets


Method get_biodiversity_names()

Return all the character names of all biodiversity datasets

Usage

BiodiversityDistribution$get_biodiversity_names()

Returns

A list with the names in the biodiversity datasets


Method plot()

Plots the content of this class.

Usage

BiodiversityDistribution$plot()

Returns

A message.


Method summary()

Summary function for this object.

Usage

BiodiversityDistribution$summary()

Returns

A message.


Method clone()

The objects of this class are cloneable with this method.

Usage

BiodiversityDistribution$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

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"