Skip to content

data.frame override hinders local development #3067

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

Closed
karawoo opened this issue Jan 15, 2019 · 3 comments
Closed

data.frame override hinders local development #3067

karawoo opened this issue Jan 15, 2019 · 3 comments

Comments

@karawoo
Copy link
Member

karawoo commented Jan 15, 2019

One consequence of data.frame() being overridden to throw an error (#2994) is that if I've loaded ggplot2 with devtools::load_all() I can't run any reprexes that use data.frame(). So if I'm working on a bug and have been given the following reprex:

library("ggplot2")
dat <- data.frame(x = c("a", "b"), y = 1:6)
ggplot(dat, aes(x = x)) +
  geom_bar()

I can't check my bug fix by running the reprex without changing the call to data.frame() and rewriting the code to avoid recycling.

I definitely see the value of avoiding any use of data.frame() within the ggplot2 codebase, but it would be really nice for interactive development to not have to rewrite all reprex code that uses data.frame(). Is there a good way around this?

@clauswilke
Copy link
Member

Does base::data.frame() work?

Or:

library("ggplot2")
data.frame <- base::data.frame
...

?

@karawoo
Copy link
Member Author

karawoo commented Jan 15, 2019

oh duh 🤦‍♀️ yes it does

@karawoo karawoo closed this as completed Jan 15, 2019
@lock
Copy link

lock bot commented Jul 14, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Jul 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants