extract_ggplot: helper function to grab relevant ggplot_build outputs

extract_ggplotR Documentation

helper function to grab relevant ggplot_build outputs

Description

takes an input function and grabs the processed data frame that ggplot employs to draw its plots

Usage

extract_ggplot(ggplot_obj)

Arguments

ggplot_obj

A ggplot object

Details

Note: reordering plot data to fit the ggplot wrangled data is (if there is a 1 to 1 mapping) plot_data[order(<facet.x>, <facet.y>, <grouping_variable>)]

OR

plot_data[order(PANEL, <grouping_variable>)]

useful for custom construction of layers


kevinmhadi/khtools documentation built on Jan. 16, 2025, 4:18 p.m.