comm.sampling {comsimitv} | R Documentation |
Converting simulation results into site-by-species matrix
Description
Converts simulation result into site-by-species matrix of abundances, and optionally in the same step simulates random sampling with fixed number of individuals.
Usage
comm.sampling(x, type = c("full", "random"), size)
Arguments
x |
community and trait data matrix produced by |
type |
Type of sampling. If |
size |
Number of individuals in the random samples. It should be smaller
than number of individuals in simulated (sub)communities. Otherwise,
|
Details
If type=="full"
it simply converts simulation results from long to wide format.
If type=="random"
it randomly selects size
individuals in each (sub)community
and abundances in these samples are converted into site-by-species matrix format.
Value
A site-by-species matrix containing abundances.
Examples
x<-comm.simul(S=20, J=30)
str(x$final.community)
w<-comm.sampling(x$final.community,type="full")
str(w)
w.rarefied<-comm.sampling(x$final.community,type="random",size=10)
rowSums(w)
rowSums(w.rarefied)