strify {mefa} | R Documentation |
Stratifies an object of class 'xcount' or 'mefa' according to levels of a factor, or sample/species attribute, respectively.
strify(xc, strata, which = c("samples", "species"))
xc |
an object of class 'xcount' or 'mefa' to be stratified. |
strata |
a vector with length equal to the number of samples/species (according to which argument).
For a 'mefa' object strata is a column within the samples/species attribute table (according to
which argument). |
which |
switch between rows ("samples" ) and columns ("species" ) to be stratified. |
A result is an object of class 'xcount'.
segment |
segment of the original object. |
data |
matrix containing count data of sample/species crosstabulation with dimensions according to stratification. Total count value is the same for the new object, but counts within strata are summed according to stratification. |
nsamples |
number of rows (samples) in data . |
nspecies |
number of columns (species) in data . |
Peter Solymos, Solymos.Peter@aotk.szie.hu, http://www.univet.hu/users/psolymos/personal/
as.xcount
, check.attrib
, mefa
, sscount
,
xcount
, xorder
## Not run: data(landsnail, vhabitat, vsample, vtable) v1 <- as.xcount(vtable, FALSE, segment="mixed") spec <- xorder(v1, which="species", landsnail, 2) sampl <- xorder(v1, which="samples", vsample) vmf <- mefa(v1, sampl, spec) v2 <- strify(vmf, strata = "site.descr", which = "samples") v2 check.attrib(v2, which="samples", vhabitat, 2) habi <- xorder(v2, which="samples", vhabitat, 2) vmf2 <- mefa(v2, habi, spec) v3 <- strify(vmf2, strata = "familia", which = "species") v3 ## End(Not run)