-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Error in ggplot2::theme(...) : could not find function "element_blank" #82
Comments
should be a reasonably straightforward fix - give me about 30 minutes and I should have a pull request in with the necessary fixes (adding explicit calls to ggplot for all the theme elements) |
Hi Andy, Do you have the code for your package on github or somewhere I can take a That said, while it's always nice to depend on as few packages as possible, Jonah P.S. It's cool you're using shinystan as part of your package! On Wednesday, August 12, 2015, Andy Yao notifications@github.com wrote:
|
hmm @jgabry so it looks like the (bigger) issue is that with the |
Yeah I had it this way because in one of the older iterations there was a On Wednesday, August 12, 2015, Devin Pastoor notifications@github.com
|
Hi Jonah and Devin! Thank you so much for such a prompt reply! My package is on github and you could access it by:
All of the code is on my github! Again, I really appreciate your help!! Edit: depending on ggplot2 is surely not a problem for me, since it is so widely used. I was just thinking/wondering that I probably shouldn't need to do that since I don't directly use ggplot2. |
andy, a quick and dirty fix would be to do if(!any(grepl("package:ggplot2", search()))) {
message("loading ggplot2 for shinystan visualizations")
library(ggplot2, quiet =TRUE)
} which will load ggplot if it hasn't already been loaded. Ultimately I think you'll be better off |
Hi Devin, Wonderful! I'll use that quick and dirty fix for now. I'll be following shinystan updates closely. If you guys update the structure of the depends/imports field I'll try it out and let you guys know. Either way, I could just use this fix or depend on ggplot2. Thanks again. Andy |
@andyyao95 sounds good - you might need to do that same hack for shiny and/or shinystan as well (you'll find out if it keeps crashing). So if you get any more bugs/crashes just post them here and we can track down the dependency code to make it explicit as we go. |
@andyyao95 If you install shinystan from this branch does your function work without having to do library(ggplot2)? |
Hi Jonah, This version works perfectly fine. Thank you for solving this issue!! Andy |
@andyyao95 great! For now these changes are just on the separate branch but On Thursday, August 13, 2015, Andy Yao notifications@github.com wrote:
|
I am developing a package which has one function that calls shinystan to visualize/diagnose my MCMC sampling. The specific function call would be:
library(my_package)
## assuming this.df is in the correct dimensions
shinystan::launch_shinystan(shinystan::as.shinystan(this.df)
And then I get this error:
It seems like
ggplot2
was not loaded, becauselibrary(shinystan)
orlibrary(ggplot2)
fixes this problem. I understand that I only imported 2 functions fromshinystan
, andggplot2
would still need to be libraried somewhere in my code. Is there anyway around this without having to depend onshinystan
orggplot2
?The text was updated successfully, but these errors were encountered: