-
-
Notifications
You must be signed in to change notification settings - Fork 28
-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve coordinates api #20
Comments
FWIW, I think the API is very straightforward and natural. But it would be nice to have an example with a data.frame or tribble in the documentation. Personally, I tend to specify coordinates using something like this, since it makes the X-Y coordinates clearer: library(ggdag)
coords <- read.table(header = TRUE, text = "
x y name
0 0 X
1 0 Z
2 0 Y
1 1 U
")
d <- dagify(
X ~ U,
Z ~ X,
Y ~ Z,
Y ~ U,
coords = coords)
ggdag(d) |
I agree that this way is much clearer and should be more evident in the docs. I think any improvements will center around using the data frame approach |
@vincentarelbundock this is a helpful suggestion. Thank you. |
I think the coordinates API is unclear, as several people (myself included) have stumbled over it or missed it altogether. I think this needs a few changes:
dag_coords()
that will overridedagitty
object coords and, if it's already tidied, update thetidy_dag
coords.However, I need to think about the second item more
The text was updated successfully, but these errors were encountered: