The print-time counterpart to ggsave_rawr(), so a report chunk can
unconditionally request a plot's display even when it was conditionally
skipped upstream. A bare symbol is looked up by name in the calling
environment; any other expression (plots[[nm]], a computed plot) is
evaluated and judged by its value, so NULL counts as "not generated".
Arguments
- input
The object to print. When it is a bare variable name, that name is used to check existence rather than the value.
- interactive
Return the plot as an interactive plotly widget (
plotly::ggplotly()) instead of a static ggplot. The report templates pass theirInteractivePlotsparam here. Objectsggplotly()cannot convert (ggpubr composites, sequence logos, base-graphics heatmaps, objects that are already widgets) are returned unchanged, so a report never breaks for requesting interactivity.Only use this from an ordinary chunk: an htmlwidget printed from inside a
results='asis'loop needs an explicittagList/knit_printdance to get its dependencies attached, and silently renders empty without it.