Debian Codegraph @

man/opts_chunk.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/defaults.R
3 \docType{data}
4 \name{opts_chunk}
5 \alias{opts_chunk}
6 \alias{opts_current}
7 \title{Default and current chunk options}
8 \format{
9 An object of class \code{list} of length 7.
10
11 An object of class \code{list} of length 7.
12 }
13 \usage{
14 opts_chunk
15
16 opts_current
17 }
18 \description{
19 Options for R code chunks. When running R code, the object \code{opts_chunk}
20 (default options) is not modified by chunk headers (local chunk options are
21 merged with default options), whereas \code{opts_current} (current options)
22 changes with different chunk headers and it always reflects the options for
23 the current chunk.
24 }
25 \details{
26 Normally we set up the global options once in the first code chunk in a
27 document using \code{opts_chunk$set()}, so that all \emph{latter} chunks will
28 use these options. Note the global options set in one chunk will not affect
29 the options in this chunk itself, and that is why we often need to set global
30 options in a separate chunk.
31
32 See \code{str(knitr::opts_chunk$get())} for a list of default chunk options.
33 }
34 \note{
35 \code{opts_current} should be treated as read-only and you are supposed
36 to only query its values via \code{opts_current$get()}. Calling
37 \code{opts_current$set()} will throw an error.
38 }
39 \examples{
40 opts_chunk$get("prompt")
41 opts_chunk$get("fig.keep")
42 }
43 \references{
44 Usage: \url{https://yihui.org/knitr/objects/}
45
46 A list of available options:
47 \url{https://yihui.org/knitr/options/#chunk-options}
48 }
49 \keyword{datasets}