?ggplot2::print.ggplot currently includes:
Value:
Invisibly returns the result of 'ggplot_build()', which is a list
with components that contain the plot itself, the data,
information about the scales, panels etc.
but the code itself is returning invisible(x), not invisible(data) (where data <- ggplot_build(x)).
If I am interpreting this correctly, then an easy fix might be from:
- Change the documentation from
result of 'ggplot_build()' to the original plot; or
- Change from
invisible(x) to invisible(data).
(Personally I prefer the second, but that might be a breaking change and require more changes than just one line, e.g., testing and/or notification of a future breaking change.)
I'm willing to submit a PR for this if there is interest.
?ggplot2::print.ggplotcurrently includes:but the code itself is returning
invisible(x), notinvisible(data)(wheredata <- ggplot_build(x)).If I am interpreting this correctly, then an easy fix might be from:
result of 'ggplot_build()'tothe original plot; orinvisible(x)toinvisible(data).(Personally I prefer the second, but that might be a breaking change and require more changes than just one line, e.g., testing and/or notification of a future breaking change.)
I'm willing to submit a PR for this if there is interest.