make.inline.fig: print markdown to create a inline figure

View source: R/make_inline_fig.R

make.inline.figR Documentation

print markdown to create a inline figure

Description

Prints proper markdown to create an inline figure from a file with or without a caption below it. Requires setting ‘results=’asis'' in chunk header.

Usage

make.inline.fig(filename, caption = NULL)

Arguments

filename

path to file of figure

caption

the caption to print below figure using the blockquote markdown syntax. Also creates a link to the original figure. default NULL

See Also

figure.caption, opts_chunk

Examples

```{r example, results='asis'}
plot.file <- "example_plot.png"
caption <- "An example plot."
ggplot::qplot(x = 1:10, y = 1:10) %>%
  ggsave(filename = plot.file)
make.inline.fig(plot.file, caption)
```

kstagaman/autoNumCaptions documentation built on Sept. 13, 2022, 12:38 p.m.