opts_chunk | R Documentation |
Options for R code chunks. When running R code, the object opts_chunk
(default options) is not modified by chunk headers (local chunk options are
merged with default options), whereas opts_current
(current options)
changes with different chunk headers and it always reflects the options for
the current chunk.
opts_chunk
opts_current
An object of class list
of length 7.
An object of class list
of length 7.
Normally we set up the global options once in the first code chunk in a
document using opts_chunk$set()
, so that all latter chunks will
use these options. Note the global options set in one chunk will not affect
the options in this chunk itself, and that is why we often need to set global
options in a separate chunk.
See str(knitr::opts_chunk$get())
for a list of default chunk options.
opts_current
should be treated as read-only and you are supposed
to only query its values via opts_current$get()
. Calling
opts_current$set()
will throw an error.
Usage: https://yihui.org/knitr/objects/
A list of available options: https://yihui.org/knitr/options/#chunk-options
opts_chunk$get("prompt")
opts_chunk$get("fig.keep")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.