Skip to content

Commit f8de0d2

Browse files
authored
Deprecate facets (#5193)
* Deprecate `facets` * Document `facets` as deprecated
1 parent b53b385 commit f8de0d2

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

R/facet-grid-.r

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ NULL
5757
#' default). If `TRUE`, margins are included for all faceting
5858
#' variables. If specified as a character vector, it is the names of
5959
#' variables for which margins are to be created.
60-
#' @param facets This argument is soft-deprecated, please use `rows`
60+
#' @param facets `r lifecycle::badge("deprecated")` Please use `rows`
6161
#' and `cols` instead.
6262
#' @export
6363
#' @examples
@@ -112,11 +112,13 @@ facet_grid <- function(rows = NULL, cols = NULL, scales = "fixed",
112112
space = "fixed", shrink = TRUE,
113113
labeller = "label_value", as.table = TRUE,
114114
switch = NULL, drop = TRUE, margins = FALSE,
115-
facets = NULL) {
116-
# `facets` is soft-deprecated and renamed to `rows`
117-
if (!is.null(facets)) {
118-
rows <- facets
115+
facets = deprecated()) {
116+
# `facets` is deprecated and renamed to `rows`
117+
if (lifecycle::is_present(facets)) {
118+
deprecate_warn0("2.2.0", "facet_grid(facets)", "facet_grid(rows)")
119+
row <- facets
119120
}
121+
120122
# Should become a warning in a future release
121123
if (is.logical(cols)) {
122124
margins <- cols

man/facet_grid.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)