This function allows the user to generate formatted code (for email,
document, copy, message, etc.) on the fly.
It accepts mainly word, pdf and html formats, but any format accepted by
rmarkdown on the computer.
To use this function, simply copy a piece of code and run
render_code() with the arguments that interest us.
If you want content that is not R code, use the code argument to
FALSE.
In pdf format, you can change the font size using the font_size
argument.
Also, you can change the browser that opens the file by default with the
browser argument.
With the argument ..., you can specify knitr arguments to be included in
the chunk. For example, you can add eval = TRUE (if you want the R
code to be evaluated (and the result displayed)), echo = FALSE (if
you don't want to display the code)...
More information in the function opts_chunk or directly
https://yihui.org/knitr/options/#chunk-options to see all available
options and their descriptions.
If the open argument is set to FALSE then the browser
argument will be ignored.