Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as_tbl_graph

Convert DAGS to tidygraph


Description

A thin wrapper to convert tidy_dagitty and dagitty objects to tbl_graph, which can then be used to work in tidygraph and ggraph directly. See tidygraph::as_tbl_graph().

Usage

## S3 method for class 'tidy_dagitty'
as_tbl_graph(x, directed = TRUE, ...)

## S3 method for class 'dagitty'
as_tbl_graph(x, directed = TRUE, ...)

Arguments

x

an object of class tidy_dagitty or dagitty

directed

logical. Should the constructed graph be directed? Default is TRUE

...

other arguments passed to as_tbl_graph

Value

a tbl_graph

Examples

library(ggraph)
library(tidygraph)
butterfly_bias() %>%
 as_tbl_graph() %>%
 ggraph() +
   geom_edge_diagonal() +
   geom_node_point()

ggdag

Analyze and Create Elegant Directed Acyclic Graphs

v0.2.3
MIT + file LICENSE
Authors
Malcolm Barrett [aut, cre] (<https://orcid.org/0000-0003-0299-5825>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.