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

@teunbrand teunbrand added this to the ggplot2 4.0.1 milestone Oct 7, 2025
Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@teunbrand teunbrand merged commit f147aaf into tidyverse:main Oct 20, 2025
13 checks passed
@teunbrand teunbrand deleted the format_devel branch October 20, 2025 09:48
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

2 participants