Created
July 11, 2024 11:19
-
-
Save lwaldron/4fe64e433f80c02e107dd02319ebae34 to your computer and use it in GitHub Desktop.
Summarize curatedMetagenomicData studies in one giant Epi Table 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(curatedMetagenomicData) | |
library(dplyr) | |
library(table1) | |
dat <- sampleMetadata |> | |
select(study_name, body_site, study_condition, age_category, age, BMI) | |
# labeling is optional, just to make the table nicer | |
label(dat$body_site) <- "Body Site" | |
label(dat$study_condition) <- "Study Condition" | |
label(dat$age_category) <- "Age Category" | |
label(dat$age) <- "Age" | |
label(dat$BMI) <- "BMI" | |
units(dat$age) <- "years" | |
table1(~ BMI + age_category + body_site + study_condition + age | study_name, data = dat, | |
transpose = FALSE, | |
dat = sampleMetadata) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output at https://rpubs.com/lwaldron/cmd_gianttable1