pull_dag | R Documentation |
pull_dag()
and pull_dag_data()
are generic methods to pull components of
DAG objects, e.g. tidy_dagitty
, such as the dagitty
object or the data
frame associated with it. These methods are recommended over extracting
components manually, e.g. my_dag$data
, because the internal structure of
these objects may change over time. Similarly, use update_dag()
if you want
to sync the data back to the DAG object or override it with another DAG; use
update_dag_data()
to do update the data frame. This is useful with
pull_dag_data()
.
pull_dag(x, ...)
## S3 method for class 'tidy_dagitty'
pull_dag(x, ...)
## S3 method for class 'dagitty'
pull_dag(x, ...)
pull_dag_data(x, ...)
## S3 method for class 'tidy_dagitty'
pull_dag_data(x, ...)
## S3 method for class 'dagitty'
pull_dag_data(x, ...)
update_dag_data(x) <- value
## S3 replacement method for class 'tidy_dagitty'
update_dag_data(x) <- value
update_dag(x, ...)
update_dag(x) <- value
## S3 method for class 'tidy_dagitty'
update_dag(x, ...)
## S3 replacement method for class 'tidy_dagitty'
update_dag(x) <- value
x |
a |
... |
For |
value |
a value to set, either a |
a DAG object, e.g. dagitty
, or data frame
tidy_dagitty_obj <- dagify(y ~ x + z, x ~ z) %>%
tidy_dagitty()
dag <- pull_dag(tidy_dagitty_obj)
dag_data <- pull_dag_data(tidy_dagitty_obj)
tidy_dagitty_obj %>%
dplyr::mutate(name = toupper(name)) %>%
# recreate the DAG component
update_dag()
dag_data$label <- paste0(dag_data$name, "(observed)")
update_dag_data(tidy_dagitty_obj) <- dag_data
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.