Skip to contents

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


PredictorDataset$new()

Initializes the object and creates an empty list

Usage

PredictorDataset$new(id, data, transformed = FALSE, ...)

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.

Returns

NULL


PredictorDataset$print()

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


PredictorDataset$get_name()

Return name of this object

Usage

PredictorDataset$get_name()

Returns

Default character name.


PredictorDataset$get_id()

Get Id of this object

Usage

PredictorDataset$get_id()

Returns

Default character name.


PredictorDataset$get_names()

Get names of data

Usage

PredictorDataset$get_names()

Returns

character names of the data value.


PredictorDataset$get_predictor_names()

Alias for get_names

Usage

PredictorDataset$get_predictor_names()

Returns

character names of the data value.


PredictorDataset$get_data()

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.

Returns

A SpatRaster or data.frame.


PredictorDataset$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.


PredictorDataset$get_projection()

Get Projection

Usage

PredictorDataset$get_projection()

Returns

A vector with the geographical projection of the object.


PredictorDataset$get_resolution()

Get Resolution

Usage

PredictorDataset$get_resolution()

Returns

A numeric vector with the spatial resolution of the data.


PredictorDataset$get_ext()

Get Extent of predictors

Usage

PredictorDataset$get_ext()

Returns

A numeric vector with the spatial resolution of the data.


PredictorDataset$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.

Returns

Invisible TRUE


PredictorDataset$mask()

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.

Returns

Invisible


PredictorDataset$set_data()

Add a new Predictor dataset to this collection

Usage

PredictorDataset$set_data(value)

Arguments

value

A new SpatRaster or stars object.

Returns

This object


PredictorDataset$rm_data()

Remove a specific Predictor by name

Usage

PredictorDataset$rm_data(x)

Arguments

x

character of the predictor name to be removed.

Returns

Invisible


PredictorDataset$show()

Alias for print method

Usage

PredictorDataset$show()

Returns

Invisible


PredictorDataset$summary()

Collect info statistics with optional decimals

Usage

PredictorDataset$summary(digits = 2)

Arguments

digits

numeric Giving the rounding precision

Returns

A data.frame summarizing the data.


PredictorDataset$has_derivates()

Indication if there are any predictors that are derivates of outers

Usage

PredictorDataset$has_derivates()

Returns

A logical flag.


PredictorDataset$is_transformed()

Predictors have been transformed?

Usage

PredictorDataset$is_transformed()

Returns

A logical flag.


PredictorDataset$is_spatial()

Is Predictor dataset spatial?

Usage

PredictorDataset$is_spatial()

Returns

A logical flag.


PredictorDataset$get_transformed_params()

Get transformation params.

Usage

PredictorDataset$get_transformed_params()

Returns

A matrix flag.


PredictorDataset$length()

Number of Predictors in object

Usage

PredictorDataset$length()

Returns

A numeric estimate


PredictorDataset$ncell()

Number of cells or values in object

Usage

PredictorDataset$ncell()

Returns

A numeric estimate


PredictorDataset$plot()

Basic Plotting function

Usage

PredictorDataset$plot()

Returns

A graphical interpretation of the predictors in this object.


PredictorDataset$clone()

The objects of this class are cloneable with this method.

Usage

PredictorDataset$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.