Skip to content

Deprecate facets#5193

Merged
teunbrand merged 2 commits intotidyverse:mainfrom
teunbrand:deprecate_facets
Feb 21, 2023
Merged

Deprecate facets#5193
teunbrand merged 2 commits intotidyverse:mainfrom
teunbrand:deprecate_facets

Conversation

@teunbrand
Copy link
Copy Markdown
Collaborator

This PR aims to fix #5189.

Briefly, the facet_grid(facets = ...) argument has been silently and informally deprecated since ggplot2 2.2.0 based on the git blame. This PR uses the lifecycle deprecation system to also start emitting warnings. Example:

library(ggplot2)

# Current ggplot2 emits no warning
f <- facet_grid(facets = vars(cyl))

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

f <- facet_grid(facets = vars(cyl))
#> Warning: The `facets` argument of `facet_grid()` is deprecated as of ggplot2 2.2.0.
#> ℹ Please use the `rows` argument instead.

Created on 2023-02-20 with reprex v2.0.2

Copy link
Copy Markdown
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
Copy link
Copy Markdown
Collaborator Author

Thanks for the review Thomas!

@teunbrand teunbrand merged commit f8de0d2 into tidyverse:main Feb 21, 2023
@teunbrand teunbrand deleted the deprecate_facets branch February 21, 2023 16:20
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.

Should facet_grid(..., facets) be deprecated?

2 participants