Skip to content

Deprecate qplot() #4079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,6 @@ Collate:
'theme.r'
'theme-defaults.r'
'theme-current.R'
'translate-qplot-ggplot.r'
'translate-qplot-lattice.r'
'utilities-break.r'
'utilities-grid.r'
'utilities-help.r'
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ggplot2 (development version)

* `qplot()` is now formally deprecated (@yutannihilation, #3956).

* Use `rlang::hash()` instead of `digest::digest()`. This update may lead to
changes in the automatic sorting of legends. In order to enforce a specific
legend order use the `order` argument in the guide. (@thomasp85, #4458)
Expand Down
15 changes: 7 additions & 8 deletions R/quick-plot.r
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#' Quick plot
#'
#' `qplot()` is a shortcut designed to be familiar if you're used to base
#' [plot()]. It's a convenient wrapper for creating a number of
#' different types of plots using a consistent calling scheme. It's great
#' for allowing you to produce plots quickly, but I highly recommend
#' learning [ggplot()] as it makes it easier to create
#' complex graphics.
#' `qplot()` is now deprecated in order to encourage the users to
#' learn [ggplot()] as it makes it easier to create complex graphics.
#'
#' @param x,y,... Aesthetics passed into each layer
#' @param data Data frame to use (optional). If not specified, will create
Expand Down Expand Up @@ -66,15 +62,18 @@ qplot <- function(x, y, ..., data, facets = NULL, margins = FALSE,
xlab = NULL, ylab = NULL,
asp = NA, stat = deprecated(), position = deprecated()) {

lifecycle::deprecate_warn("3.4.0", "qplot()")

caller_env <- parent.frame()

if (lifecycle::is_present(stat)) lifecycle::deprecate_warn("2.0.0", "qplot(stat)")
if (lifecycle::is_present(position)) lifecycle::deprecate_warn("2.0.0", "qplot(position)")
if (lifecycle::is_present(stat)) lifecycle::deprecate_stop("3.4.0", "qplot(stat)")
if (lifecycle::is_present(position)) lifecycle::deprecate_stop("3.4.0", "qplot(position)")
if (!is.character(geom)) {
cli::cli_abort("{.arg geom} must be a character vector")
}

exprs <- enquos(x = x, y = y, ...)

is_missing <- vapply(exprs, quo_is_missing, logical(1))
# treat arguments as regular parameters if they are wrapped into I() or
# if they don't have a name that is in the list of all aesthetics
Expand Down
83 changes: 0 additions & 83 deletions R/translate-qplot-ggplot.r

This file was deleted.

88 changes: 0 additions & 88 deletions R/translate-qplot-lattice.r

This file was deleted.

8 changes: 2 additions & 6 deletions man/qplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

86 changes: 0 additions & 86 deletions man/translate_qplot_ggplot.Rd

This file was deleted.

Loading