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 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

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)



[Package comsimitv version 0.1.5 Index]