makeVirtualSpecies: Generates virtual species

Description Usage Arguments Details Value Author(s) References Examples

View source: R/makeVirtualSpecies.R

Description

Generates virtual species from virtual ecological niches. The niche definition can be either provided by the user, or generated randomly.

Usage

1
2
3
4
5
6
7
makeVirtualSpecies(
variables,
niche.parameters = NULL,
seed = NULL,
species.type = "multiplicative",
max.n = NULL
)

Arguments

variables

A raster brick or stack with three or more environmental variables.

niche.parameters

A named list containing the parameters of the gaussian functions representing the niche of the species. Each slot name must be a layer name of the brick/stack variables. The slot must contain a vector with two numbers. The first represents the mean of a normal distributión, and the second represents the standard deviation of the same normal distribution. These numbers must be in the same units of the variables layer with the same name of the slot. If this argument is set to NULL, then a random set of niche parameters is generated by the function based on an uncorrelated set of predictive variables.

seed

Integer determining a random seed. Only relevant when niche.parameters = NULL. Added to allow reproducibility in the generation of random virtual species.

species.type

String, one of "additive" or "multiplicative". This is an argument of the function generateSpFromFun, which is used internally. It defines how the overall environmental suitability is computed from the response functions of each predictor. These are summed when species.type = "additive", and multiplied when species.type = "multiplicative", which is the default behavior.

max.n

Numeric integer, maximum number of presence records to extract if possible, otherwise the function returns as many presence records as possible.

Details

This function relies on the functions generateSpFromFun, convertToPA ,sampleOccurrences of the virtualspecies package, so please, cite Leroy et al. (2016) if you find this function useful.

Note that for simplicity, the settings of the functions mentioned above have been simplified. Particularly, the function convertToPA is configured with the parameters PA.method = "probability", prob.method = "linear", a = 1, and b = 0. This setting is the safest one when niche.parameters is not provided, and therefore randomized virtual taxa are being generated.

The function sampleOccurrences is configured as follows: type = "presence only"; correct.by.suitability = TRUE.

Please, check the help files of these three functions to better understand how they work!

Value

A named list with 5 slots:

Author(s)

Blas Benito <blasbenito@gmail.com>. The functions generateSpFromFun, convertToPA, and sampleOccurrences are authored by Boris Leroy <leroy.boris@gmail.com>, with help from C. N. Meynard, C. Bellard & F. Courchamp

References

Leroy, B., Meynard, C.N., Bellard, C. and Courchamp, F. (2016), virtualspecies, an R package to generate virtual species distributions. Ecography, 39: 599-607. doi:10.1111/ecog.01388

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
data("europe2000")

#niche parameters list
niche.parameters <- list(
 bio12 = c(500, 250),
 bio5 = c(240, 50),
 bio6 = c(10, 30),
 human_footprint = c(0, 30),
 topo_slope = c(0, 2),
 landcover_veg_herb = c(100, 35)
)

#making the virtual species
vs <- makeVirtualSpecies(
 variables = europe2000,
 niche.parameters = NULL,
 max.n = 200,
 species.type = "multiplicative",
 seed = NULL
)

## End(Not run)

BlasBenito/SDMworkshop documentation built on March 4, 2020, 4:16 a.m.