Skip to content

Conversation

teunbrand
Copy link
Collaborator

@teunbrand teunbrand commented Sep 26, 2025

This PR aims to fix #6526.

This fix works only in R-devel, as it relies on r-devel/r-svn@940b5c2.
I don't think it is possible to also fix this for release/old versions.
However, it is probably harmless to have a format method around, regardless of R version.

Quick demonstration:

getRversion()
#> [1] '4.6.0'
devtools::load_all("~/packages/ggplot2/")
#> ℹ Loading ggplot2

z <- iris
z$gg <- list(ggplot())
print(head(z))
#>   Sepal.Length Sepal.Width Petal.Length Petal.Width Species                gg
#> 1          5.1         3.5          1.4         0.2  setosa <ggplot2::ggplot>
#> 2          4.9         3.0          1.4         0.2  setosa <ggplot2::ggplot>
#> 3          4.7         3.2          1.3         0.2  setosa <ggplot2::ggplot>
#> 4          4.6         3.1          1.5         0.2  setosa <ggplot2::ggplot>
#> 5          5.0         3.6          1.4         0.2  setosa <ggplot2::ggplot>
#> 6          5.4         3.9          1.7         0.4  setosa <ggplot2::ggplot>

Created on 2025-09-26 with reprex v2.1.1

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.

Make sure displaying ggplot objects in a data frame doesn't error
1 participant