| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/defaults.R |
| 3 |
\docType{data} |
| 4 |
\name{opts_knit} |
| 5 |
\alias{opts_knit} |
| 6 |
\title{Options for the knitr package} |
| 7 |
\format{ |
| 8 |
An object of class \code{list} of length 7. |
| 9 |
} |
| 10 |
\usage{ |
| 11 |
opts_knit |
| 12 |
} |
| 13 |
\description{ |
| 14 |
Options including whether to use a progress bar when knitting a document, and |
| 15 |
the base directory of images, etc. |
| 16 |
} |
| 17 |
\details{ |
| 18 |
Besides the standard usage (\code{opts_knit$set()}), we can also set package |
| 19 |
options prior to loading \code{knitr} or calling \code{knit()} using |
| 20 |
\code{\link{options}()} in base R. A global option \code{knitr.package.foo} |
| 21 |
in \code{options()} will be set as an option \code{foo} in \code{opts_knit}, |
| 22 |
i.e. global options in base R with the prefix \code{knitr.package.} |
| 23 |
correspond to options in \code{opts_knit}. This can be useful to set package |
| 24 |
options in \file{~/.Rprofile} without loading \pkg{knitr}. |
| 25 |
|
| 26 |
See \code{str(knitr::opts_knit$get())} for a list of default package options. |
| 27 |
} |
| 28 |
\examples{ |
| 29 |
opts_knit$get("verbose") |
| 30 |
opts_knit$set(verbose = TRUE) # change it |
| 31 |
if (interactive()) { |
| 32 |
# for unnamed chunks, use 'fig' as the figure prefix |
| 33 |
opts_knit$set(unnamed.chunk.label = "fig") |
| 34 |
knit("001-minimal.Rmd") # from https://github.com/yihui/knitr-examples |
| 35 |
} |
| 36 |
} |
| 37 |
\references{ |
| 38 |
Usage: \url{https://yihui.org/knitr/objects/} |
| 39 |
|
| 40 |
A list of available options: |
| 41 |
\url{https://yihui.org/knitr/options/#package-options} |
| 42 |
} |
| 43 |
\keyword{datasets} |