run_hook_plot {pikchr} | R Documentation |
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.
run_hook_plot(x, options)
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. |
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.
The result of calling the current Knitr plot hook with the specified plot file and options.