fig_path

0th

Percentile

Path for figure files

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.

Usage
fig_path(suffix = "", options = opts_current$get())
Arguments
suffix
a suffix of the filename
options
a list of options; by default the options of the current chunk
Value

  • A character string (path)

Note

When there are multiple figures in a chunk, this function only provides a prefix of the filenames by default, and the actual filenames are of the form prefix1, prefix2, ... where prefix is the string returned by this function.

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.

Aliases
  • fig_path
Examples
fig_path(".pdf", list(fig.path = "figure/abc-", label = "first-plot"))
fig_path(1:10, list(fig.path = "foo-", label = "bar"))
Documentation reproduced from package knitr, version 0.9, License: GPL

Community examples

Looks like there are no examples yet.