Label or otherwise retrieve labels from objects of either class
tidy_dagitty or dagitty
Usage
label(x) <- value
# S3 method for class 'dagitty'
label(x) <- value
# S3 method for class 'tidy_dagitty'
label(x) <- value
dag_label(.tdy_dag, labels = NULL)
label(.tdy_dag)
has_labels(.tdy_dag)Arguments
- x
an object of either class
tidy_dagittyordagitty- value
a named character vector, where the names are nodes in the DAG (a name that matches no node is an error), or
NULLto remove labels- .tdy_dag
A
tidy_dagittyordagittyobject- labels
a named character vector, where the names are node names, or
NULLto reuse the labels already attached to the DAG
Examples
labelled_dag <- dagify(y ~ z, x ~ z) |>
tidy_dagitty() |>
dag_label(labels = c("x" = "exposure", "y" = "outcome", "z" = "confounder"))
has_labels(labelled_dag)
#> [1] TRUE
