I'm trying to add a ggvis plot to a Shiny app, in tab 'Plot with ggvis'. The code so far:
https://gist.github.com/tts/4cddea41992b869c2be9 runGist("4cddea41992b869c2be9")
This is OK at first. But the problem starts when I have a number of items selected, and then try to switch to another dimension, without deleting the items first. The error:
Error in `$<-.data.frame`(`*tmp*`, "keys", value = c(1L, 0L)) :
replacement has 2 rows, data has 0
In other plot renderings I can use the very handy combination of validate & need to check the input, but I seem not to be able to plug it in with ggvis. Therefore, when items() is NULL, I return all data from the reactive gvdf() function. That might the culprit.
I'd be glad if anyone could point out what I'm doing wrong.
-Tuija