A customized legend sections the group taxonomy as headers and lists the subgroup taxonomies below each group header, for all the groups.
custom_legend(
mdf,
cdf,
group_level = "Phylum",
subgroup_level = "Genus",
x = "Sample",
y = "Abundance",
legend_key_size = 0.4,
legend_text_size = 10,
legend_orientation = "vertical"
)
data.frame melted dataframe
data.frame color dataframe
string of larger taxonomic group
string of smaller taxonomic group
x-value plotted
y-value plotted
numeric determines overall size of the legend keys
integer determines size of legend text
string determines vertical or horizontal orientation of legend
complete_legend ggplot
legend_new <- custom_legend(mdf_GP, cdf_GP)
#> Error in eval(expr, envir, enclos): object 'mdf_GP' not found