gradient_sim {HTSSIP}R Documentation

Simulate HTS-SIP communities for 1 density gradient

Description

Simulate HTS-SIP communities for 1 density gradient

Usage

gradient_sim(locs, params, responseModel = "gaussian",
  countModel = "poisson", ...)

Arguments

locs

Buoyant densities of each gradient fraction

params

A matrix of parameters for coenocliner::coenocline(). See that function's documentation for more details.

responseModel

See coenocliner::coenocline()

countModel

See coenocliner::coenocline()

...

Other parameters passed to coenocliner::coenocline()

Value

A data.frame of OTU counts.

Examples

# setting parameters
set.seed(2)
M = 10                                  # number of species (OTUs)
ming = 1.67                             # gradient minimum...
maxg = 1.78                                # ...and maximum
nfrac = 24                                 # number of gradient fractions
locs = seq(ming, maxg, length=nfrac)       # gradient fraction BD values
tol = rep(0.005, M)                       # species tolerances
h = ceiling(rlnorm(M, meanlog=11))    # max abundances
opt = rnorm(M, mean=1.7, sd=0.005)      # species optima
params = cbind(opt=opt, tol=tol, h=h)  # put in a matrix
# simulate the OTU abundances
df_OTU = gradient_sim(locs, params)
head(df_OTU)


[Package HTSSIP version 1.4.1 Index]