View source: R/color_mapping_functions.R
match_cdf | R Documentation |
Now both melted dataframes will contain the same color mapping information. This can be useful if you want to make sure that different graphs have consistent legends
match_cdf(
mdf,
df_match,
df_is_mdf = TRUE,
group_level = "Phylum",
subgroup_level = "Genus"
)
mdf |
data.frame, melted data frame to apply legend to |
df_match |
data.frame, data frame to use legend from |
df_is_mdf |
logical, true if df_match is a mdf, false if df_match is a cdf |
group_level |
string of larger taxonomic group |
subgroup_level |
string of smaller taxonomic group |
data.frame, melted df with ordered factor that are consistent with the legend
mdf_to_plot <- match_cdf(mdf, df_match)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.