trait.sampling: Simulated sampling for trait value measurement

Description Usage Arguments Details Value Examples

View source: R/trait.sampling.R

Description

Randomly selects individuals for trait value measurement and gives back raw measured traits or their means

Usage

1
trait.sampling(x, ITV = FALSE, aggregate = TRUE, n = 5)

Arguments

x

community and trait data matrix produced by comm.simul function

ITV

If TRUE each subcommunity are sampled separately, otherwise the meta-community level sampling was done

aggregate

If TRUE mean trait values are returned, otherwise the raw values of sampled individuals

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

1
2
3
4
5
6
7
8
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)

comsimitv documentation built on July 17, 2021, 5:07 p.m.