| gjamTrimY {gjam} | R Documentation |
Trim gjam response data
Description
Returns a list that includes a subset of columns in y. Rare species can be aggregated into a single class.
Usage
gjamTrimY(y, minObs = 2, maxCols = NULL, OTHER = TRUE)
Arguments
y |
|
minObs |
minimum number of non-zero observations |
maxCols |
maximum number of response variables |
OTHER |
|
Details
Data sets commonly have many responses that are mostly zeros, large numbers of rare species, even singletons. Response matrix y can be trimmed to include only taxa having > minObs non-zero observations or to <= maxCol total columns. The option OTHER is recommended for composition data ('CC', 'FC'), where the 'other' column is taken as the reference class. If there are unidentified species they might be included in this class. [See gjamSimData for typeName codes].
Value
Returns a list containing three elements.
y |
trimmed version of |
colIndex |
length- |
nobs |
number of non-zero observations by column in |
Author(s)
James S Clark, jimclark@duke.edu
References
Clark, J.S., D. Nemergut, B. Seyednasrollah, P. Turner, and S. Zhang. 2017. Generalized joint attribute modeling for biodiversity analysis: Median-zero, multivariate, multifarious data. Ecological Monographs 87, 34-56.
See Also
gjamSimData simulates data
gjam analyzes data
A more detailed vignette is can be obtained with:
browseVignettes('gjam')
web site 'http://sites.nicholas.duke.edu/clarklab/code/'.
Examples
## Not run:
library(repmis)
source_data("https://github.com/jimclarkatduke/gjam/blob/master/forestTraits.RData?raw=True")
y <- gjamReZero(fungEnd$yDeZero) # re-zero data
dim(y)
y <- gjamTrimY(y, minObs = 200)$y # species in >= 200 observations
dim(y)
tail(colnames(y)) # last column is 'other'
## End(Not run)