TRUE
to do additional jobs beside the
R code in chunks. This package provides a few useful
hooks, which can also serve as examples of how to define
chunk hooks in hook_rgl(before, options, envir)hook_pdfcrop(before, options, envir)
hook_plot_custom(before, options, envir)
hook_rgl
can be set as a hook in
The function hook_pdfcrop
can use the program
par
to set appropriate margins.
Note Sys.which('pdfcrop')
to check it; if it not empty,
you are able to use it).
When the plots are not recordable via
recordPlot
and we save the plots
to files manually via other functions (e.g. hook_plot_custom
to help write code for graphics output into the output
document.
rgl.snapshot
,
rgl.postscript
knit_hooks$set(rgl = hook_rgl)
## then in code chunks, use the option rgl=TRUE
Run the code above in your browser using DataLab