Skip to content
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

Open
2 tasks
malcolmbarrett opened this issue Dec 6, 2019 · 3 comments
Open
2 tasks

Improve coordinates api #20

malcolmbarrett opened this issue Dec 6, 2019 · 3 comments
Milestone

Comments

@malcolmbarrett
Copy link
Collaborator

malcolmbarrett commented Dec 6, 2019

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:

  • Examples in the new customizing DAGs vignette
  • A separate function that can specify coordinates, something like dag_coords() that will override dagitty object coords and, if it's already tidied, update the tidy_dag coords.

However, I need to think about the second item more

@malcolmbarrett malcolmbarrett changed the title coordinates api Improve coordinates api Dec 6, 2019
@malcolmbarrett malcolmbarrett added this to the ggdag 0.3.0 milestone Dec 6, 2019
@vincentarelbundock
Copy link

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)

@malcolmbarrett
Copy link
Collaborator Author

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

@go-bayes
Copy link

go-bayes commented Dec 1, 2021

@vincentarelbundock this is a helpful suggestion. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants