trait.sampling {comsimitv} | R Documentation |
Simulated sampling for trait value measurement
Description
Randomly selects individuals for trait value measurement and gives back raw measured traits or their means
Usage
trait.sampling(x, ITV = FALSE, aggregate = TRUE, n = 5)
Arguments
x |
community and trait data matrix produced by |
ITV |
If |
aggregate |
If |
n |
Number of sampled individuals |
Details
It simulates the real world situation that not all individuals are collected for trait measurement.
If ITV==FALSE
, all individuals belonging to the species are pooled, and then n
randomly selected individuals are measured. If ITV==TRUE
, n
individuals are
measured in each (sub)community, where the species occur. If the occurring individuals are
less than n
, all individuals are measured.
If aggregate==TRUE
, meta-community or subcommunity level means are calculated, otherwise
raw measurements are returned.
Value
data.frame with fields: species
, site
(only if ITV=TRUE
),
trait.a
, trait.b
, trait.c
(raw values or means depending on parameter aggregate
)
Examples
x<-comm.simul(S=20, J=30)
str(x)
w<-trait.sampling(x$final.community)
w
w<-trait.sampling(x$final.community,ITV=TRUE,aggregate=TRUE)
str(w)