Skip to main content

make_grob

Function make_grob 

Source
fn make_grob(
    type_class: &str,
    entries: Vec<(String, RValue)>,
    draw: bool,
    vp: RValue,
    ctx: &BuiltinContext<'_>,
) -> Result<RValue, RError>
Expand description

Helper to create a grob and optionally draw it.

  1. Creates the grob R object (list with class c(type_class, "grob"))
  2. If draw=TRUE, records it on the display list
  3. If vp is provided, pushes the viewport, records the grob, pops the viewport
  4. Returns the grob invisibly