ggsrc: Add source file label to a ggplot object

View source: R/fn_gg.R

ggsrcR Documentation

Add source file label to a ggplot object

Description

Add a label with the current source file path and run time to a ggplot object.

Usage

ggsrc(
  plt,
  span = 1,
  size = 8,
  col = "grey55",
  lab = NULL,
  omit = "",
  tz = TRUE
)

Arguments

plt

A ggplot object.

span

⁠<num>⁠ Number of lines: either 1 or 2.

size

⁠<num>⁠ Text size.

col

⁠<chr>⁠ Colour of the text.

lab

⁠<chr>⁠ Custom label to use instead of the default.

omit

⁠<chr>⁠ Text to omit from the label.

tz

⁠<lgl>⁠ FALSE to exclude time stamp.

Value

A ggplot object with the added label.

Examples

p = mtcars |> ggxy(mpg,hp)
p |> ggsrc()
p |> ggsrc(lab="My label")
p |> ggsrc(lab="My label",omit="My ")

edar documentation built on Nov. 15, 2026, 1:07 a.m.