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

Formulas should be allowed #146

Closed
ldecicco-USGS opened this issue Jul 22, 2015 · 9 comments
Closed

Formulas should be allowed #146

ldecicco-USGS opened this issue Jul 22, 2015 · 9 comments
Assignees
Labels

Comments

@ldecicco-USGS
Copy link
Member

plot(-3:3,-3:3)
points(y~x)

library(gsplot)
gs <- gsplot() %>%
  points(y~x)
gs
@jordansread
Copy link
Member

see #151

@ldecicco-USGS
Copy link
Member Author

I think this is going to be a little trickier...not 100% sure. Have to make sure plot calls plot.formula appropriately. Also, plot.factor? plot.ts? plot.data.frame? plot.function?

@jordansread
Copy link
Member

I linked in the wrong issue for that last comment. I have not worked on this issue. Agree that it will be tricky.

@jordansread
Copy link
Member

I think we need something like this when we look up the function, and then failover to .default:

getS3method('points',class(object), optional=TRUE)

which works for class(object) == 'formula'

@jordansread
Copy link
Member

  • support for base plot override (i.e., what LDC has above breaks when gsplot is loaded
  • support for using formulas in gsplot workflow (the second example from LDC)

jordansread pushed a commit to jordansread/gsplot that referenced this issue Jul 25, 2015
@jordansread
Copy link
Member

see #159 which takes care of the first thing.

@jordansread jordansread self-assigned this Jul 26, 2015
@jordansread
Copy link
Member

Is this still open?

What is the criteria for closing?

this works

gs <- gsplot() %>%
    points(y~x, data=list(x=-3:3,y=-3:3))
gs

what other patterns do we have? ones that look to the parent.frame for x and y as well?

@ldecicco-USGS
Copy link
Member Author

I didn't check, but does it work for lines too? That was the one thing I was going to check before closing.

@jordansread
Copy link
Member

yep, it does

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

No branches or pull requests

2 participants