This class describes the PredictorDataset and is used to store covariates within.
Public fields
id
The id for this collection as character.
data
A predictor dataset usually as SpatRaster.
name
A name for this object.
transformed
Saves whether the predictors have been transformed somehow.
timeperiod
A timeperiod field
is.spatial
A logical flag on whether the predictor is spatial or not.
Methods
Method new()
Initializes the object and creates an empty list
Arguments
id
The id for this collection as character.
data
A predictor dataset usually as SpatRaster.
transformed
A logical flag if predictors have been transformed. Assume not.
...
Any other parameters found.
Print the names and properties of all Biodiversity datasets contained within
Usage
PredictorDataset$print(format = TRUE)
Arguments
format
A logical flag on whether a message should be printed.
Returns
A message on screen
Method get_name()
Return name of this object
Usage
PredictorDataset$get_name()
Method get_id()
Get Id of this object
Usage
PredictorDataset$get_id()
Method get_names()
Get names of data
Usage
PredictorDataset$get_names()
Method get_predictor_names()
Alias for get_names
Usage
PredictorDataset$get_predictor_names()
Get a specific dataset
Usage
PredictorDataset$get_data(df = FALSE, na.rm = TRUE, ...)
Arguments
df
logical on whether data is to be returned as data.frame.
na.rm
logical if NA is to be removed from data.frame.
...
Any other parameters passed on.
Method get_time()
Get time dimension of object.
Usage
PredictorDataset$get_time(...)
Arguments
...
Any other parameters passed on.
Returns
A vector with the time dimension of the dataset.
Method get_projection()
Get Projection
Usage
PredictorDataset$get_projection()
Returns
A vector with the geographical projection of the object.
Method get_resolution()
Get Resolution
Usage
PredictorDataset$get_resolution()
Returns
A numeric vector with the spatial resolution of the data.
Method get_ext()
Get Extent of predictors
Usage
PredictorDataset$get_ext()
Returns
A numeric vector with the spatial resolution of the data.
Method crop_data()
Utility function to clip the predictor dataset by another dataset
Usage
PredictorDataset$crop_data(pol, apply_time = FALSE)
Arguments
pol
A sf object used for cropping the data.
apply_time
A logical flag indicating if time should be acknowledged in cropping.
Details
This code now also is able to determine the temporally closest
layer. In case a data.frame exists as predictor, only that is returned.
Utility function to mask the predictor dataset by another dataset
Usage
PredictorDataset$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 masking.
Method set_data()
Add a new Predictor dataset to this collection
Usage
PredictorDataset$set_data(value)
Arguments
value
A new SpatRaster or stars object.
Method rm_data()
Remove a specific Predictor by name
Usage
PredictorDataset$rm_data(x)
Arguments
x
character of the predictor name to be removed.
Method show()
Alias for print method
Collect info statistics with optional decimals
Usage
PredictorDataset$summary(digits = 2)
Arguments
digits
numeric Giving the rounding precision
Method has_derivates()
Indication if there are any predictors that are derivates of outers
Usage
PredictorDataset$has_derivates()
Predictors have been transformed?
Usage
PredictorDataset$is_transformed()
Method is_spatial()
Is Predictor dataset spatial?
Usage
PredictorDataset$is_spatial()
Get transformation params.
Usage
PredictorDataset$get_transformed_params()
Number of Predictors in object
Usage
PredictorDataset$length()
Method ncell()
Number of cells or values in object
Basic Plotting function
Returns
A graphical interpretation of the predictors in this object.
Method clone()
The objects of this class are cloneable with this method.
Usage
PredictorDataset$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.