ggdag 0.1.0

I’m pleased to announce the release of ggdag 0.1.0 on CRAN! ggdag uses the powerful dagitty package to create and analyze structural causal models and plot them using ggplot2 and ggraph in a tidy, consistent, and easy manner. You can use dagitty objects directly in ggdag, but ggdag also includes wrappers to make DAGs using a more R-like syntax:

# install.packages("ggdag")

dag <- dagify(y ~ x + z,
       x ~ z) %>% 

## # A DAG with 3 nodes and 3 edges
## #
## # A tibble: 4 x 8
##   name      x     y direction to     xend  yend circular
##   <chr> <dbl> <dbl> <fct>     <chr> <dbl> <dbl> <lgl>   
## 1 x      6.14  2.04 ->        y      5.18  1.75 FALSE   
## 2 z      5.92  1.06 ->        x      6.14  2.04 FALSE   
## 3 z      5.92  1.06 ->        y      5.18  1.75 FALSE   
## 4 y      5.18  1.75 <NA>      <NA>  NA    NA    FALSE

You can learn more about it on the ggdag website, a pkgdown site that includes rendered documentation and the following vignettes:

Give it a try, and please file an bugs or suggestions to the GitHub repo.

I also want to thank a few of my fellow USC PhDs, David Bogumil, Ugonna Ihenacho, and Zhi Yang, for helping me polish the articles and offering helpful suggestions on some of the aesthetic details of ggdag. Thanks, y’all!

Malcolm Barrett
Data Scientist

I am a data scientist, an R developer, and an epidemiologist. My work in public health has spanned on-ground clinical education and research for clinical and cohort studies. Previously, I was an intern at RStudio, and I served two years in AmeriCorps at federally-qualified health centers in Michigan and New York City.
Sponsor me on GitHub