jtextor / dagitty

Graphical analysis of structural causal models / graphical causal models.
GNU General Public License v2.0
255 stars 47 forks source link

use `writeLines()` to print empty adjustment sets to match other sets #95

Open malcolmbarrett opened 1 month ago

malcolmbarrett commented 1 month ago

When printing an adjustment set where one of the sets is empty, there is a visual inconsistency in the empty set vs the others. The empty set is off to the right by a few characters.

library(dagitty)
dagitty("x -> y; z -> y") |>
  adjustmentSets(exposure = "x", outcome = "y", type = "all")
#>  {}
#> { z }

Created on 2024-06-18 with reprex v2.1.0

This PR uses writeLines() instead of cat() to match the output of other sets.