Skip to content

Relax 1d atomic vectors or lists requirement #2609

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
hadley opened this issue May 15, 2018 · 2 comments
Closed

Relax 1d atomic vectors or lists requirement #2609

hadley opened this issue May 15, 2018 · 2 comments
Labels
bug an unexpected problem or unintended behavior layers 📈
Milestone

Comments

@hadley
Copy link
Member

hadley commented May 15, 2018

As it's breaking many revdeps so will likely have deleterious impact on user code

@hadley hadley added bug an unexpected problem or unintended behavior layers 📈 labels May 15, 2018
@hadley hadley added this to the v2.3.0 milestone May 15, 2018
@hadley
Copy link
Member Author

hadley commented May 17, 2018

@lionel- can you take on this one? I'm not going to have time since I'm teaching Thursday and Friday.

The problem arises from the use of as_tibble() in three places. On the whole, I think the increased strictness of tibble is a good thing but it causes problems with some base R functions which 1d arrays like (like scale(), as in #2374). I think the simplest solution probably to switch to tibble::new_tibble(), but it requires a little thought. Any solution should include a PR that ensures this works:

df <- data.frame(x = 1:10)
df$y <- scale(1:10)
  
p <- ggplot(df, aes(x, y)) + geom_point()
layer_data(p)

Beware that data.frame(x = scale(1:10)) strips the dim attribute that causes the problem.

It'd be great if you could check a couple of the revdeps that fail to make sure this actually fixes the problem (easiest way is to search https://docs.google.com/spreadsheets/d/1UZIFwt3j3XjnRGOMNJZvpal_CAj7Hz8aNXJt41m3JjM/edit#gid=0 for "atomic vector")

lionel- added a commit that referenced this issue May 19, 2018
hadley pushed a commit that referenced this issue May 19, 2018
@lock
Copy link

lock bot commented Nov 15, 2018

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 Nov 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior layers 📈
Projects
None yet
Development

No branches or pull requests

1 participant