Learn R Programming

caugi (version 1.0.0)

caugi_options: Get or set global options for caugi

Description

Configure global defaults for caugi, including plot composition spacing and default visual styles for nodes, edges, labels, and titles.

Usage

caugi_options(...)

Value

When setting, returns (invisibly) the previous values for the updated options. When getting (no arguments or unnamed character vector), returns the requested options.

Arguments

...

Named values to update options with, or unnamed option names to retrieve. To query all options, call without arguments.

Details

Currently supported options are nested under the plot key:

  • spacing: A grid::unit() controlling space between composed plots (default: grid::unit(1, "lines"))

  • node_style: List of default node appearance parameters:

    • fill: Fill color (default: "lightgrey")

    • padding: Padding around labels in mm (default: 2)

    • size: Size multiplier (default: 1)

  • edge_style: List of default edge appearance parameters:

    • arrow_size: Arrow size in mm (default: 3)

    • circle_size: Radius of endpoint circles for partial edges in mm (default: 1.5)

    • fill: Arrow/line color (default: "black")

  • label_style: List of label text parameters (see grid::gpar())

  • title_style: List of title text parameters:

    • col: Text color (default: "black")

    • fontface: Font face (default: "bold")

    • fontsize: Font size in pts (default: 14.4)

Options set via caugi_options() serve as global defaults that can be overridden by arguments to plot().

See Also

plot() for per-plot style arguments, grid::gpar() for available graphical parameters

Examples

Run this code
# Query all options
caugi_options()

# Query specific option
caugi_options("plot")

# Set plot spacing
caugi_options(plot = list(spacing = grid::unit(2, "lines")))

# Set default node style
caugi_options(plot = list(
  node_style = list(fill = "lightblue", padding = 3)
))

# Set multiple options at once
caugi_options(plot = list(
  spacing = grid::unit(1.5, "lines"),
  node_style = list(fill = "lightblue", padding = 3),
  edge_style = list(arrow_size = 4, fill = "darkgray"),
  title_style = list(col = "blue", fontsize = 16)
))

# Reset to defaults
caugi_options(caugi_default_options())

Run the code above in your browser using DataLab