virtual_data: Generate new data based on virtual niche

View source: R/virtual_data.R

virtual_dataR Documentation

Generate new data based on virtual niche

Description

Generate new data based on virtual niche

Usage

virtual_data(features, from = c("ellipsoid", "prediction"),
             data = NULL, prediction = NULL, n = 100, tol = 1e-8)

Arguments

features

list of characteristics that defined the ellipsoid. This list ca be obtained using the function ell_features.

from

(character) where to generate or sample data from. Options are "ellipsoid" or "prediction". Default = "ellipsoid" .

data

matrix or data.frame containing values (at least environmental values) used to obtain prediction based on features. Needed if from = "prediction" and the list used in argument prediction contains results of class numeric. Not required if the list used in argument prediction contains results of class RasterLayer.

prediction

list of predictions based on features and data, obtained using the function ell_predict. Needed if from = "prediction".

n

(numeric) size of data to be generated (number of points). Default = 100.

tol

(numeric) the tolerance for detecting linear dependencies. Default = 1e-8.

Details

Generation of virtual data is done using the function mvrnorm when from = "ellipsoid".

Virtual data is generated according to suitability values (multivariate normal probabilities) when from = "prediction". In this case defining the arguments data and prediction is mandatory if the elements in prediction are of class numeric. If elements in prediction are of class RasterLayer, data is not required.

Value

A matrix or data.frame with the virtual data generated.


marlonecobos/evniche documentation built on Oct. 25, 2024, 4:03 a.m.