Here's a working example:
cocaine %>%
ggvis(~potency, ~price) %>%
filter(state %in% eval(input_checkboxgroup(c("IA", "MN", "WI"),
selected = "WI"))) %>%
layer_points(fill = ~state, size := 50, opacity := 0.5)
I made two changes:
* Both dplyr and ggvis using non-standard evaluation in slightly
different ways, so filter() needs a bit of a hint that
input_checkboxgroup() should be evaluated different. Surround it in
eval() to force it to be evaluated eagerly (this is documented in
filter.ggvis)
* Currently the default selected value is NULL, which selects no
values, and hence ggvis tries to plot an empty data frame and fails
(this is a bug). So you also need to check at least one group by
default. I've filed an issue about this :
https://github.com/rstudio/ggvis/issues/272
Hadley
> --
> You received this message because you are subscribed to the Google Groups
> "ggvis" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
ggvis+un...@googlegroups.com.
> To post to this group, send email to
gg...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.
--
http://had.co.nz/