Description Usage Arguments Details Value Author(s) References Examples
View source: R/makeVirtualSpecies.R
Generates virtual species from virtual ecological niches. The niche definition can be either provided by the user, or generated randomly.
1 2 3 4 5 6 7 | makeVirtualSpecies(
variables,
niche.parameters = NULL,
seed = NULL,
species.type = "multiplicative",
max.n = NULL
)
|
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 |
seed |
Integer determining a random seed. Only relevant when |
species.type |
String, one of "additive" or "multiplicative". This is an argument of the function |
max.n |
Numeric integer, maximum number of presence records to extract if possible, otherwise the function returns as many presence records as possible. |
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!
A named list with 5 slots:
niche.dimensions: Names of the variables used to define the niche of the virtual species.
niche.parameters: Either the same niche.parameters
used as input, or the niche definition generated randomly by the function if niche.parameters = NULL
.
niche.plot: A ggplot with the density plots of the presence records (represented in blue) and the background (represented in yellow), and a habitat suitability map with presence records.
suitability.raster: A habitat suitability raster generated from the niche parameters by the function generateSpFromFun
.
observed.presence: A dataframe with the coordinates x and y (in the same coordinate reference system as variables
) of the selected presences.
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
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
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.