run_hook_plot {pikchr} | R Documentation |
Run Plot Hook and Record Plot Filenames
Description
This function records the filenames of plot outputs (such as SVG or PNG files) in the Knitr environment and then runs the appropriate plot hook to display or save the plots.
Usage
run_hook_plot(x, options)
Arguments
x |
A character string representing the path to the plot file. |
options |
A list of options associated with the Knitr chunk, such as plot settings and output options. |
Details
The 'run_hook_plot' function appends the plot file path to the internal Knitr option 'plot_files'. It then retrieves the current plot hook defined in 'knit_hooks' and calls it to handle the plot rendering or output. This function is particularly useful for handling plots generated from both R code and other outputs like HTML widgets.
Value
The result of calling the current Knitr plot hook with the specified plot file and options.