fig_path {knitr} | R Documentation |
The filename of figure files is the combination of options fig.path
and label
. This function returns the path of figures for the current
chunk by default.
fig_path(suffix = "", options = opts_current$get(), number)
suffix |
a suffix of the filename; if it is not empty, nor does it
contain a dot |
options |
a list of options; by default the options of the current chunk |
number |
the current figure number (by default the internal chunk option
|
A character vector of the form ‘fig.path-label-i.suffix’.
When there are special characters (not alphanumeric or - or _) in the path, they will be automatically replaced with _. For example, ‘a b/c.d-’ will be sanitized to ‘a_b/c_d-’. This makes the filenames safe to LaTeX.
fig_path(".pdf", options = list(fig.path = "figure/abc-", label = "first-plot")) fig_path(".png", list(fig.path = "foo-", label = "bar"), 1:10)