no interoperability with shiny
I am using ggtern with shiny in cocktailApp (on CRAN). The received wisdom from https://github.com/rstudio/shiny/issues/915 is that a ggtern plot handle should not be returned from a call to renderPlot, rather one should print() the handle and return NULL. That is, I have been using:
output$tern_plot <- renderPlot({
ph <- make_ggtern_plot( ... )
print(ph)
NULL
})
I think I made some upgrades to packages in my system and this now throws odd errors of the form
Error: unused argument (<environment>)
If I return the plot handle via
output$tern_plot <- renderPlot({
ph <- make_ggtern_plot( ... )
ph
})
the ternary plot does not look right: no grid lines, the axis labels are wrong, etc. The ticket 915 suggested that ggtern should not overload print.ggplot or build_gtable. That's a bit over my head.
Comments (9)
-
-
Same situation for me. I hope you're OK Nicholas. Until ggtern gets updated I'll have to revert to a different ternary solution for my tricolore package. The vcd package has a grid-based ternary plotting function. May be an alternative for @shabbychef as well.
-
Jonas: Thanks for the suggestion. After doing some research, I discovered the
Ternary
package on CRAN, which has fewer dependencies thanvcd
. It is likely I will have to migrate to one of these. -
Steven: The Ternary package does indeed seem nicer than the vcd implementation though its use of base plot instead of grid will increase the likelihood of code breaking for my users. I just share this in case its relevant for you as well: When your users write code like
foo <- TernaryPlot(x)
, this will still be possible with an alternative grid-based ternary implementation, but not with a base-plot implementation. -
repo owner Hi Guys,
The bitbucket version should have this fixed, I'll be pushing to CRAN probably tonight.
Please let me know if you run into any issues with ggplot2, as this fix was processed rapidly to prevent ggtern getting kicked off CRAN and of course, so that you could get your packages operational again.
Apologies for the delay and inconvenience.
Regards,
NH
-
Thank you so much @nicholashamilton. The ggtern part of my package works again. Happy that you push to CRAN. Are you in contact with Kurt?
-
repo owner Good to hear. Yes I have been in contact, thanks very much...
-
great, thanks. I had already ported my code to
Ternary
, but don't like the syntax or the end result; I'll have to port it back toggtern
. -
repo owner sorry for the hassle
- Log in to comment
Note that I have now received notice from CRAN team that
ggtern
will be archived and removed from CRAN because they cannot contact the author, and that my package, which depends onggtern
, will have to be updated.