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
label
fig_path(suffix = "", options = opts_current$get(), number)
A filename suffix; if it is non-empty and does not contain a dot ., it will be treated as the filename extension (e.g. png will be used as .png)
.
png
.png
A list of options; by default the options of the current chunk.
The current figure number. The default is the internal chunk option fig.cur, if this is available.
fig.cur
A character vector of the form fig.path-label-i.suffix.
fig.path-label-i.suffix
# NOT RUN { fig_path(".pdf", options = list(fig.path = "figure/abc-", label = "first-plot")) fig_path(".png", list(fig.path = "foo-", label = "bar"), 1:10) # }
Run the code above in your browser using DataLab