Skip to content

Commit 775f1b4

Browse files
Deprecate qplot() (#4079)
1 parent 99149fc commit 775f1b4

24 files changed

+76
-966
lines changed

DESCRIPTION

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,6 @@ Collate:
262262
'theme.r'
263263
'theme-defaults.r'
264264
'theme-current.R'
265-
'translate-qplot-ggplot.r'
266-
'translate-qplot-lattice.r'
267265
'utilities-break.r'
268266
'utilities-grid.r'
269267
'utilities-help.r'

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# ggplot2 (development version)
22

3+
* `qplot()` is now formally deprecated (@yutannihilation, #3956).
4+
35
* Use `rlang::hash()` instead of `digest::digest()`. This update may lead to
46
changes in the automatic sorting of legends. In order to enforce a specific
57
legend order use the `order` argument in the guide. (@thomasp85, #4458)

R/quick-plot.r

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
#' Quick plot
22
#'
3-
#' `qplot()` is a shortcut designed to be familiar if you're used to base
4-
#' [plot()]. It's a convenient wrapper for creating a number of
5-
#' different types of plots using a consistent calling scheme. It's great
6-
#' for allowing you to produce plots quickly, but I highly recommend
7-
#' learning [ggplot()] as it makes it easier to create
8-
#' complex graphics.
3+
#' `qplot()` is now deprecated in order to encourage the users to
4+
#' learn [ggplot()] as it makes it easier to create complex graphics.
95
#'
106
#' @param x,y,... Aesthetics passed into each layer
117
#' @param data Data frame to use (optional). If not specified, will create
@@ -66,15 +62,18 @@ qplot <- function(x, y, ..., data, facets = NULL, margins = FALSE,
6662
xlab = NULL, ylab = NULL,
6763
asp = NA, stat = deprecated(), position = deprecated()) {
6864

65+
lifecycle::deprecate_warn("3.4.0", "qplot()")
66+
6967
caller_env <- parent.frame()
7068

71-
if (lifecycle::is_present(stat)) lifecycle::deprecate_warn("2.0.0", "qplot(stat)")
72-
if (lifecycle::is_present(position)) lifecycle::deprecate_warn("2.0.0", "qplot(position)")
69+
if (lifecycle::is_present(stat)) lifecycle::deprecate_stop("3.4.0", "qplot(stat)")
70+
if (lifecycle::is_present(position)) lifecycle::deprecate_stop("3.4.0", "qplot(position)")
7371
if (!is.character(geom)) {
7472
cli::cli_abort("{.arg geom} must be a character vector")
7573
}
7674

7775
exprs <- enquos(x = x, y = y, ...)
76+
7877
is_missing <- vapply(exprs, quo_is_missing, logical(1))
7978
# treat arguments as regular parameters if they are wrapped into I() or
8079
# if they don't have a name that is in the list of all aesthetics

R/translate-qplot-ggplot.r

Lines changed: 0 additions & 83 deletions
This file was deleted.

R/translate-qplot-lattice.r

Lines changed: 0 additions & 88 deletions
This file was deleted.

man/qplot.Rd

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

man/translate_qplot_ggplot.Rd

Lines changed: 0 additions & 86 deletions
This file was deleted.

0 commit comments

Comments
 (0)