-
Notifications
You must be signed in to change notification settings - Fork 16
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
Fix base plot "checking for variable name" #75
Conversation
Thanks, Moritz. (As I had already indicated in the Poisson PR I was about to provide a fix for that in a separate PR.) The problem is that Regarding the |
Separate but related question (possibly better for a separate issue): The way the |
Ah yes we do seem to have a lot of plotting functions floating around. Instead of a single
I'm intrigued, what are you thinking here?
I'm open to changing this; basically the current way we represent a distribution is a quickly thrown together hack. I started thinking about a more careful class system a while back but didn't really have the capacity to push it anywhere. As a start it seems like subclasses for discrete and for continuous distributions would be an easy win, and I would welcome a PR to make those changes. |
My bad. I have adjusted the code accordingly! |
I understand your point, on the other hand But thinking about it again, wouldn't that imply that the arguments are 1:1 interchangeable - which will not be really the case. What do you think, @alexpghayes and @zeileis? |
When I first wrote the My original idea was to create
Unfortunately, I didn't have time to dive deep enough into how to write As @alexpghayes, I would prefer to keep the Anyway, just wanted to chime in. If anyone wants to work on an implementation that functions as a |
Thanks everybody for the discussion so far. I will try to structure my feedback on the different aspects a bit. Discrete vs. continuous
Functions vs. methods
ggplot2 dependency
|
Merging the fix in for now, let's continue discussion about plotting code refactor at #77. |
Alex (@alexpghayes),
this contains a minor PR for fixing the warnings in the base plot generic encountered in PR #74 by @zeileis. The plot function currently checks if the variable name is a single upper case letter.
This only works for existing distribution objects:
More generally, would you like me to write an issue or even a PR to unify the plot functions? Currently there is a
plot.distributions3()
with the boolean argumentcdf
, as well as the functionsplot_pdf()
andplot_cdf()
based on ggplot2:plot()
andautoplot()
with the argumentstype = c("pdf", "cdf"))
.ggdist
?