File: fig_path.Rd

package info (click to toggle)
r-cran-knitr 1.50%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 1,864 kB
  • sloc: makefile: 16; sh: 10; javascript: 8
file content (36 lines) | stat: -rw-r--r-- 1,295 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{fig_path}
\alias{fig_path}
\title{Path for figure files}
\usage{
fig_path(suffix = "", options = opts_current$get(), number)
}
\arguments{
\item{suffix}{A filename suffix; if it is non-empty and does not
contain a dot \code{.}, it will be treated as the filename extension (e.g.
\code{png} will be used as \code{.png})}

\item{options}{A list of options; by default the options of the current chunk.}

\item{number}{The current figure number. The default is the internal chunk option
\code{fig.cur}, if this is available.}
}
\value{
A character vector of the form \file{fig.path-label-i.suffix}.
}
\description{
The filename of figure files is the combination of options \code{fig.path}
and \code{label}. This function returns the path of figures for the current
chunk by default.
}
\note{
When there are special characters (not alphanumeric or \samp{-} or
  \samp{_}) in the path, they will be automatically replaced with \samp{_}.
  For example, \file{a b/c.d-} will be sanitized to \file{a_b/c_d-}. This
  makes the filenames safe to LaTeX.
}
\examples{
fig_path(".pdf", options = list(fig.path = "figure/abc-", label = "first-plot"))
fig_path(".png", list(fig.path = "foo-", label = "bar"), 1:10)
}