fig: Cross reference a figure caption

Description Usage Format Value See Also Examples

Description

list, cross reference a 'fig.cap' in r markdown with label and link of pdf

Usage

1

Format

An object of class list of length 2.

Value

The number of the figure increases in order. fig$ref("chunk") returns the figure number followed by the string Figure. You don't have to worry changed order of plots while documentation. Also, they provide hyperlink in pdf document so that you can easily approach the plots.

refer

of '$cap' refer the figure caption, same as the chunk name

title

of '$cap' caption of the plot

refer

of '$ref' cross refer the corresponding figure by number

See Also

tab Table numbering

Examples

1
2
3
4
5
6
library(ggplot2)
ggplot(data = mpg, aes(x = displ, y = hwy)) +
  geom_point() +
  labs(caption = fig$cap("fig-chunk-name", "Caption name"))
fig$ref("fig-chunk-name")
## For detailed usage, see the vignette

ygeunkim/rmdtool documentation built on July 1, 2019, 1:57 p.m.