Skip to content
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

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

Closed
yutannihilation opened this issue Apr 21, 2020 · 10 comments · Fixed by #4079
Closed

Comments

@yutannihilation
Copy link
Member

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.

@hadley
Copy link
Member

hadley commented Apr 21, 2020

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

@clauswilke
Copy link
Member

I think this is a great idea.

@etiennebr
Copy link

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.

@yutannihilation
Copy link
Member Author

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...

@dcgerard
Copy link

dcgerard commented Nov 6, 2022

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.

@bwiernik
Copy link
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/

@fab4ap
Copy link

fab4ap commented Aug 8, 2023

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!

@thomasp85
Copy link
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.

@fab4ap
Copy link

fab4ap commented Aug 8, 2023

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

@thomasp85
Copy link
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants