Skip to contents

Renders the lineage graph returned by lg_lineage() as an interactive inline widget (using DiagrammeR if installed), or writes the DOT source to a file for rendering with Graphviz externally.

Usage

lg_plot(lineage, output = NULL)

Arguments

lineage

An lg_lineage object from lg_lineage().

output

Character or NULL. File path for DOT output (e.g. "pipeline.dot"). When NULL (default), renders inline using DiagrammeR::grViz() if available, otherwise prints the DOT source to the console.

Value

The lg_lineage object, invisibly.

See also

Examples

lg_start()
#> lineager: session started
pts <- lg_tag(
  data.frame(
    USUBJID = c("P01", "P02"),
    eligible = c(TRUE, FALSE),
    stringsAsFactors = FALSE
  ),
  dataset_id = "PATIENTS"
)
#> lineager: tagged 'PATIENTS' — 2 rows, 2 cols
lg_filter(pts, eligible, reason = "Not eligible")
#> lineager: [PATIENTS] filter 'Not eligible' — 2 in, 1 out, 1 excluded
#> <lg_df> 'PATIENTS'  [1 × 3]
#>   USUBJID eligible
#> 1     P01     TRUE
lin <- lg_lineage()
lg_plot(lin)
lg_end()
#> lineager: session ended — 1 operation(s), 1 exclusion(s), 0 population(s), 0 var spec(s)