-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New error triggered in compute_group #1826
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
Comments
I should have told above, that this error is triggered only in some stats, apparently depending on the code of the compute function. |
Could you please try and create a minimal reprex that doesn't use any ggpmisc code? |
I will try to make a reprex during the coming weekend. This is rather tricky as I am unable to set breakpoints in RStudio in the compute group function and adding a print(data) statement removes the error in the same way as force(data) does. Preparing a reprex will be just a question of trial and error unless you have a suggestion for how to more directly trace the problem. I get related errors for several different stats in two different packages, but I cannot yet see a pattern across these stats that gives a hint of what is going on. Some of them are roughly based on the stat_summary code from ggplot2 2.1.0 or maybe 2.0.0. They do not use make_summary_fun() as in ggplot2 2.2.0. |
Having ggplot2 in depends: and importing the whole package seems to also solve the problem. Or maybe updating to scales 0.4.0.9002 helped as this happened automatically when I installed ggplot2 from Github today. I will not have time to explore this in more depth until the weekend. |
It's possible that simply rebuilding your package might've fixed the problem. Could you please check to see if that's the case? |
Yes, this seems to be the case. I had started suspecting the same yesterday. The problem is that if built with the ggplot2 version from Github my package triggers errors when run if the CRAN version of ggplot2 is installed... So, the problem really only affects the binary. This complicates installation from binaries. I can release new versions of my packages and make them depend on ggplot2 2.2.0. I will be able to submit them to CRAN only after 2.2.0 has been released. Or is there any better option? |
I am not sure but I suspect that this is also the case for 'ggrepel': under some circumstances it triggers an error that vanishes when ggrepel is rebuilt or installed from sources. |
The errors reported by your automatic checks for my other packages photobiologyPlants and photobiologyInOut were just caused by package ggspectra being used in their vignettes. |
I think the problem is with the way ggproto works. I'll need to talk this over with @wch to confirm. We might be able to avoid the problem just by asking CRAN to rebuild on release. |
After some discussion with @hadley, I think the source of the problem is that ggproto's inheritance is implemented by saving the superclass object. When ggproto object in package B (call it This is the line in question: I think it should be possible to do this:
|
@lgautier No it was not meant to fix it. 'ggtern' package's code needs an update before it will work. I do not know how big a rewrite is needed, but ggtern has code modifying ggplot2's internal functions, and redefines generics like ggplot. One of these functions has apparently been removed or renamed in ggplot. I think the maintainer plans an update but I have no idea when he will do it. The git repository for ggtern is in Bitbucket at https://bitbucket.org/nicholasehamilton/ggtern. Most recent commit was 2 months ago. Issue tracking is not enabled. To learn more you need to contact the maintainer by e-mail or through a web form at http://www.ggtern.com/. |
@aphalo Thanks. I am asking the maintainer whether issue tracking could be enabled. |
@lgautier He made several commits today. Looks like he will soon submit the update to CRAN. |
In both 'ggpmisc' and 'ggspectra' I was getting a rather cryptic error triggered in my compute_group functions.
Error in as.vector(y) : attempt to apply non-function
With the following traceback
It can be easily fixed by adding
force(data)
as the first statement in my compute_group function. I haven't seen this error the previous time I tested with 'ggplot2' from Github (some weeks ago).This does not necessarily need a fix, but thought good to document it here in case someone else faces some problem.
The text was updated successfully, but these errors were encountered: