ggvis object in Shiny app, problem with reactivity

72 views
Skip to first unread message

Tuija Sonkkila

unread,
Jul 2, 2014, 8:49:17 AM7/2/14
to gg...@googlegroups.com
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.

Here is the same code without ggvis runGist("5df86b664b840c5927f9") also live at https://ttso.shinyapps.io/AaltoAltm/

-Tuija

Tuija Sonkkila

unread,
Jul 3, 2014, 9:17:07 AM7/3/14
to gg...@googlegroups.com
My question was perhaps out of scope of this group, so I opened a question to StackOverflow instead http://stackoverflow.com/questions/24554734/dynamic-ggvis-object-in-shiny 

-Tuija

Tuija Sonkkila

unread,
Jul 4, 2014, 3:46:13 AM7/4/14
to gg...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages