insert_figure: Helper for inserting external figures into an R Markdown...

View source: R/insert_figure.R

insert_figureR Documentation

Helper for inserting external figures into an R Markdown document

Description

Wraps knitr::include_graphics() to easily access my custom directory structure for paper writing'

Usage

insert_figure(
  stem,
  type = dplyr::if_else(knitr::is_latex_output(), "pdf", "png"),
  base = "figures"
)

Arguments

stem

Character. Basename of figure, without extension.

type

Character. Format of the file. Defaults to knitr and dplyr logic.

base

Character. Defaults to my usual structure of having a top-level folder for figures, abbreviated ⁠figures/⁠, but could also be 'figs/'


evanmascitti/ecmfuns documentation built on April 5, 2025, 1:52 a.m.