figure: Generate a figure object.

View source: R/classes.R

figureR Documentation

Generate a figure object.

Description

Bundles a ggplot/cowplot object, file reference, the final rendered graphic dimensions and markdown references in one figure object.

Usage

figure(
  x,
  label,
  w,
  h,
  unit = c("mm", "cm", "in"),
  ref_name = NULL,
  caption = NULL,
  legend_text = NULL
)

Arguments

x

a ggplot/cowplot object

label

the final file name

w

the final width after saving/rendering

h

the final height after saving/rendering

unit

the unit of h and w, mm be default

ref_name

optional, name of the reference to the figure, used mainly in markdown documents.

caption

optional, text to be presented in the figure caption.

legend_text

optional, text to be presented in the extended figure legend.

Details

ref_name: needs to be a valid markdown/bookdown reference name. By default, spaces, slashes and underscores are silently turned into '-'. You may easily insert the read-to-use figure object code chunk into your Rmarkdown document with the 'insert()' method or reference it in the text by calling 'refer()'.

Value

An object of class 'figure'


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