if (FALSE) {
# Parse data for examples
x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
class_key = c(tax_rank = "taxon_rank", tax_name = "taxon_name"),
class_regex = "^(.+)__(.+)$")
# Calculate the means for each group
calc_group_mean(x, "tax_data", hmp_samples$sex)
# Use only some columns
calc_group_mean(x, "tax_data", hmp_samples$sex[4:20],
cols = hmp_samples$sample_id[4:20])
# Including all other columns in ouput
calc_group_mean(x, "tax_data", groups = hmp_samples$sex,
other_cols = TRUE)
# Inlcuding specific columns in output
calc_group_mean(x, "tax_data", groups = hmp_samples$sex,
other_cols = 2)
calc_group_mean(x, "tax_data", groups = hmp_samples$sex,
other_cols = "otu_id")
# Rename output columns
calc_group_mean(x, "tax_data", groups = hmp_samples$sex,
out_names = c("Women", "Men"))
}
Run the code above in your browser using DataLab