Transforms the plot data. Many functions in this package require a specific
data format to align observations, plot_data()
helps reformat data frames
as needed.
Arguments
- data
A function to transform the plot data before rendering, referred to as
plot_data
. Acceptable values include:NULL
: No action taken.waiver()
: Inherits from the parent layout.A
function
or purrr-styleformula
: Used to transform the plot data, which should accept a data frame and return a data frame. You can apply this after the parent layoutplot_data
function, using theinherit
argument.
Use this hook to modify the data for all
geoms
after the layout is created (for matrix data, it has been melted to a long format data frame) but before rendering byggplot2
. The returned data must be a data frame for ggplot.- inherit
A single boolean value indicates whether to apply the parent
plot_data
first and then apply the specifiedplot_data
for the plot. Defaults toFALSE
.
Details
Defaults will attempt to inherit from the parent layout if the actual data is
inherited from the parent layout, with one exception: align_dendro()
, which
will not inherit the plot_data
by default.