Methods
Method new()
Initializes the object and creates an empty list
Arguments
name
A description of the model as character
.
Method get_name()
Return the name of the model
Usage
DistributionModel$get_name()
Returns
A character
with the model name used.
Print the names and summarizes the model within
Usage
DistributionModel$print()
Returns
A message on screen
Method show()
Show the name of the Model.
Plots the prediction if found.
Usage
DistributionModel$plot(what = "mean")
Arguments
what
character
with the specific layer to be plotted.
Returns
A graphical representation of the prediction
Method plot_threshold()
Plots the thresholded prediction if found.
Usage
DistributionModel$plot_threshold(what = 1)
Returns
A graphical representation of the thresholded prediction if found.
Method show_duration()
Show model run time if settings exist
Usage
DistributionModel$show_duration()
Returns
A numeric
estimate of the duration it took to fit the models.
Get effects or importance tables from model
Usage
DistributionModel$summary(obj = "fit_best")
Returns
A data.frame
summarizing the model, usually its coefficient.
Generic plotting function for effect plots
Usage
DistributionModel$effects(x = "fit_best", what = "fixed", ...)
Arguments
x
A character
for the object in question.
what
A character
for the type of coefficients.
...
Any other options.
Returns
A graphical representation of the coefficents.
Method get_equation()
Get equation
Usage
DistributionModel$get_equation()
Returns
A formula
of the inferred model.
Get specific fit from this Model
Usage
DistributionModel$get_data(x = "prediction")
Arguments
x
A character
stating what should be returned.
Returns
A SpatRaster
object with the prediction.
Method get_model()
Small internal helper function to directly get the model object
Usage
DistributionModel$get_model()
Returns
A fitted model if existing.
Method set_data()
Set new fit for this Model.
Usage
DistributionModel$set_data(x, value)
Arguments
x
The name of the new fit.
value
The SpatRaster
layer (or model) to be inserted.
Method get_thresholdvalue()
Get the threshold value if calculated
Usage
DistributionModel$get_thresholdvalue()
Method get_thresholdtype()
Get threshold type and format if calculated.
Usage
DistributionModel$get_thresholdtype()
Method show_rasters()
List all rasters in object
Usage
DistributionModel$show_rasters()
Method get_projection()
Get projection of the background.
Usage
DistributionModel$get_projection()
Returns
A geographic projection
Method get_resolution()
Get the resolution of the projection
Usage
DistributionModel$get_resolution()
Returns
numeric
estimates of the distribution.
Method rm_threshold()
Remove calculated thresholds
Usage
DistributionModel$rm_threshold()
Method calc_suitabilityindex()
Calculate a suitability index for a given projection
Usage
DistributionModel$calc_suitabilityindex(method = "normalize")
Arguments
method
The method used for normalization.
Details
Methods can either be normalized by the minimum and maximum.
Or the relative total using the sumof values.
Returns
Returns a SpatRaster
.
Method get_centroid()
Get centroids of prediction layers
Usage
DistributionModel$get_centroid(patch = FALSE, layer = "mean")
Arguments
patch
A logical
if centroid should be calculated weighted by values.
layer
character
of the layer to use.
Returns
Returns a sf
object.
Method has_limits()
Logical indication if the prediction was limited.
Usage
DistributionModel$has_limits()
Method has_latent()
Logical indication if the prediction has added latent factors.
Usage
DistributionModel$has_latent()
Method has_offset()
Has a offset been used?
Usage
DistributionModel$has_offset()
Convenience function to mask all input datasets.
Usage
DistributionModel$mask(mask, inverse = FALSE, ...)
Arguments
mask
A SpatRaster
or sf
object.
inverse
A logical
flag if the inverse should be masked instead.
...
Any other parameters passed on to mask
Save the prediction as output.
Usage
DistributionModel$save(fname, type = "gtif", dt = "FLT4S")
Arguments
fname
An output filename as character
.
type
A format as character
. Matched against a list of supported formats.
dt
The datatype used, such as float64
Returns
Saved spatial prediction on drive.
Method clone()
The objects of this class are cloneable with this method.
Usage
DistributionModel$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.