tbl_sum_samdata: Summarize information from sample data in a table

View source: R/dada_phyloseq.R

tbl_sum_samdataR Documentation

Summarize information from sample data in a table

Description

lifecycle-experimental

A wrapper for the gtsummary::tbl_summary() function in the case of physeq object.

Usage

tbl_sum_samdata(physeq, remove_col_unique_value = TRUE, ...)

Arguments

physeq

(required): a phyloseq-class object obtained using the phyloseq package.

remove_col_unique_value

(logical, default TRUE) Do we remove informative columns (categorical column with one value per samples), e.g. samples names ?

...

Other arguments pass on to gtsummary::tbl_summary().

Details

This function is mainly a wrapper of the work of others. Please make a reference to gtsummary::tbl_summary() if you use this function.

Value

A new phyloseq-class object with a larger slot tax_table

Author(s)

Adrien Taudière

Examples

if (requireNamespace("gtsummary")) {
  tbl_sum_samdata(data_fungi) %>%
    gtsummary::as_kable()

  summary_samdata <- tbl_sum_samdata(data_fungi,
    include = c("Time", "Height"),
    type = list(Time ~ "continuous2", Height ~ "categorical"),
    statistic = list(Time ~ c("{median} ({p25}, {p75})", "{min}, {max}"))
  )
}

data(enterotype)
if (requireNamespace("gtsummary")) {
  summary_samdata <- tbl_sum_samdata(enterotype)
  summary_samdata <- tbl_sum_samdata(enterotype, include = !contains("SampleId"))
}


adrientaudiere/MiscMetabar documentation built on Oct. 13, 2024, 9:42 p.m.