make.set: Function to simulate species data

View source: R/simulate_species.r

make.setR Documentation

Function to simulate species data

Description

Function to simulate species data following Minchin (1987). This functions generates species response functions, simulates environmental variables and simulates species assemblages based on species response functions and environmental variables. Users can as well supply own species parameters (e.g. when simulating calibration and fossil datasets) and own environmental variables.

Usage

make.set(ndim, n, elen, emean, edistr, ecor, cnt, spec, env,...)

Arguments

ndim

Number of environmental variables to generate.

n

Number of samples to be generated.

elen

Range of the environmental variables. Single number or vector of length ndim.

emean

Mean of the environmental variables. Single number or vector of length ndim.

edistr

Distribution of the environmental variables. Currently 'uniform' and 'Gaussian' are supported.

ecor

Correlation matrix of the environmental variables supplied by user. Object generated by cor.mat.fun. If omitted environmental variables are uncorrelated.

cnt

Number of counts to be simulated.

spec

Users may supply their own species parameters.

env

Users may supply their own environmental variables.

...

Arguments passed to species

Value

spp

Species abundance data.

env

Environmental variables used to simulate species abundance data.

spec

Species parameters.

Author(s)

Mathias Trachsel and Richard J. Telford

References

Minchin, P.R. (1987) Multidimensional Community Patterns: Towards a Comprehensive Model. Vegetatio, 71, 145-156.

See Also

make.env, species, cor.mat.fun

Examples

calib <- make.set(nspp = 90,ndim = 3,Amax = runif,fun = runif, xpar = c(-50,150), 
    srange = 400, alpha = 4, gamma = 4,n = 100,elen =rep(100,3),emean = rep(50,3),
    edistr ='uniform', cnt = 1000)

# Provide species parameters generated above, so that the fossil data use the 
#    same species parameters.
fos <- make.set(ndim = 3,n = 100,elen =rep(100,3),emean = rep(50,3), edistr ='uniform',
    cnt = 1000, spec = calib$spec)  

# Supplying own environmental variables and species parameters.
env.vars <- make.env(100,elen =rep(100,3),emean = rep(50,3), edistr ='uniform',ndim = 3)
fos <- make.set(cnt = 1000, spec = calib$spec, env = env.vars)  



palaeoSig documentation built on March 31, 2023, 9:34 p.m.