-
-
Notifications
You must be signed in to change notification settings - Fork 118
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
Issues masking S4 methods #15
Comments
I can't think of a better name than |
Posted related question on stackoverflow: http://stackoverflow.com/questions/31127056/why-does-print-of-s4-class-call-show-without-namespacing-it |
Unfortunately I can't really offer more insight here. I ran into the problem quite unexpectedly and automatically assumed that if someone needed to budge it should be you since the methods package is maintained by the R core team. With that said I do appreciate your confusion with |
Yes, I definitely agree that if anyone should budge, it should be me and not R :) |
Cool - thanks! |
This issue has been reported to the R core team and was fixed in R and will be available in R 3.3.0. Here is the commit that fixes this - SVN commit # 68702 (you can use the unstable R-devel version to see the fix live) A shorter reproducible example of the bug (which is unrelated to shinyjs) is the following:
Just for completeness, I want to point out that in the original report it is said that calling Thanks for reporting @jonmcalder ! |
Hi Dean, Thank you very much for addressing this issue. Thank you, once again! |
@Gnolam I did not fix it on my end :) In the dev version of R this won't happen, but as far as I know, if you're using R 3.2 you'll still see this problem. Can you show your |
Hi Dean, It would be difficult to recollect the shinyjs version exactly. Please find the session info below: locale: attached base packages: other attached packages: loaded via a namespace (and not attached): |
Thanks @Gnolam , that's still very strange. I just tried using R 3.2.1 and the latest shinyjs, and I do still get an error when running
It's a different error than before because I changed the internal code, but it's still weird that on R < 3.3 you're not seeing an error with the above exact code. |
In this case it is strange indeed. As it is working. I have recently reinstalled R/Rstudio from scratch. |
Hi, I have tried once again and the results I get are: An object of class "testS4Object" Could be a problem caused by set of installed packages? |
Reported by Jon Calder:
I've noticed that when attaching the shinyjs package, "removeClass", and "show" are masked from 'package:methods’. It took me a long time to work out that this was causing problems in the shiny app I am working on at the moment. This is because 'show' gets called when using print on an S4 object, which I happen to be using all over the place to check and debug the structure of S4 objects which I'm creating dynamically within the app.
Just to clarify with a simple example, if 'shinyjs' is attached while running the below code:
Then one gets the error:
Error in dynGetCopy("session") : ‘session’ not found
I assume the error originates here in this function: https://github.com/daattali/shinyjs/blob/master/R/jsFunc-aaa.R
Once I realized what the issue was, it was easy to get around this by using methods::show() instead of just show(), but since this error message only crops up when running the code in an interactive R session and not while running a shiny app (as will be the case with most people like me using your package for the first time), it took some time to work through a process of elimination and find the source of the problem.
Since S4 is widely used, I think it would probably be wise to rename your 'show' function to something else that won't cause this conflict for people going forward? Then it's one less thing to trip people up in the use of your package.
The text was updated successfully, but these errors were encountered: