insert_figure: Insert a reference to figure objects into a Rmarkdown file.

View source: R/markdown_tools.R

insert_figureR Documentation

Insert a reference to figure objects into a Rmarkdown file.

Description

Builds a character with the R code chunks for the given figure objects.

Usage

insert_figure(
  ...,
  file = NULL,
  ref_names = NULL,
  captions = NULL,
  legend = TRUE,
  legend_text = "<<legend>>",
  html = FALSE,
  style_ref = "legend",
  append = FALSE
)

Arguments

...

figure objects.

file

a file to which the chunks are written. If the file exists already, it will be appended or overwritten. If NULL, the text is printed in the console.

ref_names

names of the figure chunk in the R markdown output. If NULL, default names ('figure1', 'figure2' and so on) are used.

captions

figure captions. If NULL, default captions ('caption for figure 1' and so on) are used.

legend

logical, should a text with the figure reference in bold be included below the figure chunk?

legend_text

a character vector or list with detailed legend texts.

html

logical: should the legend be HTML styled?

style_ref

name of the CSS style of the legend text, valid only for the HTML output.

append

logical, should the output file be appended?

Value

invisibly retuns a ready-to-use figure chunk text.


PiotrTymoszuk/figur documentation built on July 16, 2024, 1:15 a.m.