# NOT RUN {
# 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)
# }
Run the code above in your browser using DataLab