| mp_aggregate_clade {MicrobiotaProcess} | R Documentation |
calculate the mean/median (relative) abundance of internal nodes according to their children tips.
mp_aggregate_clade( .data, .abundance = NULL, force = FALSE, relative = TRUE, aggregate_fun = mean, action = "get", ... ) ## S4 method for signature 'MPSE' mp_aggregate_clade( .data, .abundance = NULL, force = FALSE, relative = TRUE, aggregate_fun = mean, action = "get", ... ) ## S4 method for signature 'tbl_mpse' mp_aggregate_clade( .data, .abundance = NULL, force = FALSE, relative = TRUE, aggregate_fun = mean, action = "get", ... ) ## S4 method for signature 'grouped_df_mpse' mp_aggregate_clade( .data, .abundance = NULL, force = FALSE, relative = TRUE, aggregate_fun = mean, action = "get", ... )
.data |
MPSE object which must contain otutree slot, required |
.abundance |
the column names of abundance. |
force |
logical whether calculate the (relative) abundance forcibly when the abundance is not be rarefied, default is FALSE. |
relative |
logical whether calculate the relative abundance. |
aggregate_fun |
function the method to calculate the (relative) abundance of internal nodes according to their children tips, default is mean. |
action |
character, "add" joins the new information to the otutree slot if it exists (default). In addition, "only" return a non-redundant tibble with the just new information. "get" return 'otutree' slot, which is a treedata object. |
... |
additional parameters, meaningless now. |
a object according to 'action' argument.
## Not run:
suppressPackageStartupMessages(library(curatedMetagenomicData))
xx <- curatedMetagenomicData('ZellerG_2014.relative_abundance', dryrun=F)
xx[[1]] %>% as.mpse -> mpse
otu.tree <- mpse %>%
mp_aggregate_clade(
.abundance = Abundance,
force = TRUE,
relative = FALSE,
action = 'get' # other option is 'add' or 'only'.
)
otu.tree
## End(Not run)