View source: R/Sim_Community.R
sim_thomas_community | R Documentation |
This function simulates a community with a certain abundance distribution and with intraspecific aggregation, i.e. individuals of the same species are distributed in clusters.
sim_thomas_community(
s_pool,
n_sim,
sad_type = "lnorm",
sad_coef = list(cv_abund = 1),
fix_s_sim = FALSE,
sigma = 0.02,
cluster_points = NA,
mother_points = NA,
xmother = NA,
ymother = NA,
xrange = c(0, 1),
yrange = c(0, 1),
seed = NULL
)
s_pool |
Number of species in the pool (integer) |
n_sim |
Number of individuals in the simulated community (integer) |
sad_type |
Root name of the species abundance distribution model of the
species pool (character) - e.g., "lnorm" for the lognormal distribution
( See the table in Details below, or |
sad_coef |
List with named arguments to be passed to the distribution
function defined by the argument In Please note that the parameters mu and sigma are not equal to the mean and standard deviation of the log-normal distribution. |
fix_s_sim |
Should the simulation constrain the number of species in the simulated local community? (logical) |
sigma |
Mean displacement (along each coordinate axes) of a point from
its mother point (= cluster centre). |
cluster_points |
Mean number of points per cluster. If this is
a single value, species have the same average number of points per cluster.
If this is a vector of the same length as |
mother_points |
Number of mother points (= cluster centres).
If this is a single value, all species have the same number of clusters.
For example |
xmother |
List of length equal to the number of species. Each list element is a vector of x coordinates for every mother points. If one element is NA, the the corresponding species is not clustered. |
ymother |
List of length equal to the number of species. Each list element is a vector of y coordinates for every mother points. If one element is NA, the the corresponding species is not clustered. |
xrange |
Extent of the community in x-direction. If this a numeric vector
of length 2, all species share the same range. To specify different x ranges for
all species, |
yrange |
Extent of the community in y-direction. If this a numeric vector
of length 2, all species share the same range. To specify different y ranges for
all species, |
seed |
Integer. Any integer passed to |
This function consecutively calls sim_sad
and
sim_thomas_coords
See the documentations of sim_sad
and
sim_thomas_coords
for details.
A community object as defined by community
Felix May
com1 <- sim_thomas_community(s_pool = 20, n_sim = 500, sad_type = "lnorm",
sad_coef = list("meanlog" = 2, "sdlog" = 1),
sigma = 0.01)
plot(com1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.