To customize the color order in the plot, use this function to directly assign groups a specific color

color_reassign(cdf, group_assignment, color_assignment, group_level = "Phylum")

Arguments

cdf

data.frame containing the color key

group_assignment

string vector of taxonomic groups

color_assignment

sting vector of corresponding color assignment

group_level

string indiating the taxonomic level of group_assignment

Value

cdf data.frame

Examples

library(phyloseq)
data(GlobalPatterns)

mdf <- prep_mdf(GlobalPatterns)

color_obj <- create_color_dfs(mdf)

mdf_group <- color_obj$mdf
cdf <- color_obj$cdf

new_cdf <- color_reassign(cdf,
                          group_assignment = c("Firmicutes", "Actinobacteria"),
                          color_assignment = c("micro_cvd_blue", "micro_cvd_purple"))