Debian Codegraph @

man/fig_path.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/utils.R
3 \name{fig_path}
4 \alias{fig_path}
5 \title{Path for figure files}
6 \usage{
7 fig_path(suffix = "", options = opts_current$get(), number)
8 }
9 \arguments{
10 \item{suffix}{A filename suffix; if it is non-empty and does not
11 contain a dot \code{.}, it will be treated as the filename extension (e.g.
12 \code{png} will be used as \code{.png})}
13
14 \item{options}{A list of options; by default the options of the current chunk.}
15
16 \item{number}{The current figure number. The default is the internal chunk option
17 \code{fig.cur}, if this is available.}
18 }
19 \value{
20 A character vector of the form \file{fig.path-label-i.suffix}.
21 }
22 \description{
23 The filename of figure files is the combination of options \code{fig.path}
24 and \code{label}. This function returns the path of figures for the current
25 chunk by default.
26 }
27 \note{
28 When there are special characters (not alphanumeric or \samp{-} or
29 \samp{_}) in the path, they will be automatically replaced with \samp{_}.
30 For example, \file{a b/c.d-} will be sanitized to \file{a_b/c_d-}. This
31 makes the filenames safe to LaTeX.
32 }
33 \examples{
34 fig_path(".pdf", options = list(fig.path = "figure/abc-", label = "first-plot"))
35 fig_path(".png", list(fig.path = "foo-", label = "bar"), 1:10)
36 }