match_cdf: Apply the color factoring from one cdf to a different melted...

View source: R/color_mapping_functions.R

match_cdfR Documentation

Apply the color factoring from one cdf to a different melted data frame

Description

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

Usage

match_cdf(
  mdf,
  df_match,
  df_is_mdf = TRUE,
  group_level = "Phylum",
  subgroup_level = "Genus"
)

Arguments

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

Value

data.frame, melted df with ordered factor that are consistent with the legend

Examples

mdf_to_plot <- match_cdf(mdf, df_match)


KarstensLab/microshades documentation built on June 11, 2024, 11:41 a.m.