table_one: Produce a summary data.frame of key demographic variables

View source: R/table_one.R

table_oneR Documentation

Produce a summary data.frame of key demographic variables

Description

Sometimes it is desirable to produce a summary of key demographic variables for presentation. The table_one and kable_one methods are a quick way to do so – they not only summarize key demographic variables from SummarizedExperiment-class object(s) in the HMP16SData package but remove abbreviations and underscores in column and variable names that might otherwise be ambigious. The table_one method returns a tidy (i.e. one sample observation per line) data.frame object or a named list of tidy data.frame objects. The kable_one method can then be used to produce a publication-ready HTML table that could, for example, be pasted into a word processor.

Usage

table_one(
  x,
  VISITNO = TRUE,
  SEX = TRUE,
  RUN_CENTER = TRUE,
  HMP_BODY_SITE = TRUE,
  HMP_BODY_SUBSITE = TRUE
)

Arguments

x

A SummarizedExperiment-class object or a named list of SummarizedExperiment-class objects from the HMP16SData package

VISITNO

logical; if FALSE, the VISITNO column(s) of SummarizedExperiment colData will not be summarized

SEX

logical; if FALSE, the SEX column(s) of SummarizedExperiment colData will not be summarized

RUN_CENTER

logical; if FALSE, the RUN_CENTER column(s) of SummarizedExperiment colData will not be summarized

HMP_BODY_SITE

logical; if FALSE, the HMP_BODY_SITE column(s) of SummarizedExperiment colData will not be summarized

HMP_BODY_SUBSITE

logical; if FALSE, the HMP_BODY_SUBSITE column(s) of SummarizedExperiment colData will not be summarized

Value

A data.frame object or a named list of data.frame objects

See Also

kable_one

Examples

V13() %>%
    table_one()


waldronlab/HMP16SData documentation built on Oct. 26, 2023, 5:42 a.m.