Skip to content

Remove stat and position arguments from qplot() and formaly deprecate the function #3956

Closed

Description

@yutannihilation

stat and position were deprecated 4.5 years ago (v2.0.0), so I think it's time to remove them. I think we have no development bandwidth to fix such tricky bugs like #3670.

Also, can we agree on deprecating qplot() itself? Though we've never discussed this formally, I believe the use of qplot() is discouraged, which virtually means it's deprecated.

Activity

  1. hadley commented on Apr 21, 2020

    @hadley
    Member

    I’m fine with removing the stat and position args, and starting the deprecation for qplot.

  2. clauswilke commented on Apr 21, 2020

    @clauswilke
    Member

    I think this is a great idea.

  3. added this to the ggplot2 3.4.0 milestone on Apr 21, 2020
  4. etiennebr commented on May 4, 2020

    @etiennebr

    I won't win a popularity contest I guess, but I must say I use qplot quite often when doing interactive analysis and before deciding to use the whole ggplot scaffold. However, I reorder the arguments to make it pipeable:

    #' Create quick and tidy plots
    qtplot <- function(data = data, ...) ggplot2::qplot(..., data = data)
    
    mtcars %>% qtplot(mpg, cyl)

    This is not the battle I will die for, but I wanted to bring another voice.

  5. yutannihilation commented on May 6, 2020

    @yutannihilation
    MemberAuthor

    In my understanding, though we're deprecating qplot(), it's not that qplot() is totally useless, but it's just inconsistent to include the function outside of Grammar of Graphics in ggplot2. We sometimes want a shortcut for common usages and it's fine to use it as long as you know when you shouldn't. But, it's not the case for most of the ggplot2 beginners. Personally, I hope some nicer version of qplot() will be born as an extension package...

  6. dcgerard commented on Nov 6, 2022

    @dcgerard

    Just wanted to add that I really like qplot()! When I teach a non-R course (like regression) and have very little time to teach R, it's very easy to teach students qplot(), and this gives them most of what they need, without having to go through full ggplot.

  7. bwiernik commented on Nov 14, 2022

    @bwiernik
    Contributor

    Just wanted to add that I really like qplot()! When I teach a non-R course (like regression) and have very little time to teach R, it's very easy to teach students qplot(), and this gives them most of what they need, without having to go through full ggplot.

    For this sort of context, you might consider using a package that let's you skip having to specifically teach ggplot2 entirely by providing automatic plots for common uses. For example, the easystats packages can produce automatic diagnostic and predictions plots for regression without needing to teach the nuances of ggplot2: https://easystats.github.io/easystats/

  8. fab4ap commented on Aug 8, 2023

    @fab4ap

    I find qplot to be extremely useful for multiple uses since it provides a simple intuitive format. Wonder why there is need to deprecate it. If somebody wants a richer and more complicated version, they can always use ggplot!

  9. thomasp85 commented on Aug 8, 2023

    @thomasp85
    Member

    Because maintaining the function is more trouble than it is worth and it can hinder users in learning to use the more powerful grammar API.

  10. fab4ap commented on Aug 8, 2023

    @fab4ap

    I get the first part but not how it can hinder users (if they want to learn the more powerful API, they can!) :)

  11. thomasp85 commented on Aug 9, 2023

    @thomasp85
    Member

    You can easily get trapped in a constrained API for longer than needed. The existence of two orthogonal APIs where one of them is severely constrained will def keep some users in the constrained one longer than is good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions