View source: R/aggregateTaxa.R
aggregateTaxa | R Documentation |
This function aggregates taxa according to their rank from a measure passed in weights: if a taxa has a lower rank than its coarser level, type = 'coarse', it is aggregated into the coarser; if their is a unique thinner level with a better rank than the coarser one, then the coarser is aggregated into the thiner Comparison is done only for the family, genus and specie levels.
aggregateTaxa(
taxa,
features = NULL,
weights = NULL,
thr = NULL,
type = "coarse"
)
taxa |
taxa should be a data.frame with the feature name and all its other coarser/thinner levels (columns: 'Feature', 'f', 'g', 's') |
features |
if taxa is a vector or a data.frame that lacks all levels, a vector of the features to be checked. |
weights |
a data.frame with a column Feature and a column weight; for type = 'both' or 'coarse' only. |
thr |
numeric, value after which the algorithm should stop looking for better ranks in a taxonomic branch; for type = 'both' or 'coarse' only. If NULL, the median of weights is used. |
type |
character. If 'coarse', finer levels are aggregated into their coarser one if it has a better rank. If 'fine' then coarser levels are aggregated into a thinner level if it has a better rank and is unique, i.e. there is a unique finer level for that coarser level. If 'both', both aggregation steps are seuqentially performed. |
A dataframe with aggregated features in the "Feature" column, and the 'recipient' taxa in the "newFeature" column.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.