Skip to contents

[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 ?

...

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

Value

A new phyloseq-class object with a larger slot tax_table

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.

Author

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}"))
  )
}
# \donttest{
data(enterotype)
if (requireNamespace("gtsummary")) {
  summary_samdata <- tbl_sum_samdata(enterotype)
  summary_samdata <- tbl_sum_samdata(enterotype, include = !contains("SampleId"))
}
# }