jtextor / dagitty

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

Suggesstion for improvement in manual #94

Open ar0berts opened 4 months ago

ar0berts commented 4 months ago

The example in dagitty::dagitty works fine if there are no quoted numbers but fails if a dag is copied from dagitty.net.

please change the examples given from:

# Specify a simple DAG containing one path g <- dagitty("dag{ a -> b ; b -> c ; d -> c }")

to

# Specify a simple DAG containing one path g <- dagitty('dag{ a -> b ; b -> c ; d -> c }')

(and the same for the other examples)

This enables text copied from the web version to be pasted in without throwing an Error: unexpected numeric constant in: error:

library(dagitty, ggdag) d<-dagitty('dag { bb="0,0,1,1" cause [exposure,pos="0.218,0.247"] effect [outcome,pos="0.552,0.513"] mediator [pos="0.507,0.202"] cause -> mediator mediator -> effect }')

Thanks.