Skip to content

Restore as.table #5900

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
wants to merge 1 commit into from
Closed

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #5898.

Briefly, some extensions require as.table to be present, which this PR restores. Instead of incorporating as.table in dir in the constructor, we now do this in wrap_layout().

It pains me a little bit, as I was quite pleased that we could get rid of as.table as a parameter before and now we have to bring back this vestigial parameter.

@teunbrand
Copy link
Collaborator Author

A reprex with this PR:

devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2
library(deeptime)

df <- data.frame(x = 1:10, y = 1:10, period = c("Permian", "Triassic"))
ggplot(df) +
  geom_point(aes(x, y)) +
  facet_wrap_color(vars(period), colors = periods)

Created on 2024-05-21 with reprex v2.1.0

Whereas on main, the same code gives:

#> Error in `data_frame()` at ggplot2/R/utilities.R:351:16:
#> ! Can't recycle `ROW` (size 0) to size 2.

@thomasp85
Copy link
Member

could we deprecate it gracefully instead of committing to having it around for eternity?

@teunbrand
Copy link
Collaborator Author

I'd like to but this is proving to be a bit more finnicky that I anticipated.

@teunbrand
Copy link
Collaborator Author

closing this in favour of #5907

@teunbrand teunbrand closed this May 24, 2024
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

Successfully merging this pull request may close these issues.

Fallback for facet_wrap(as.table)
2 participants