shiny - Reactive input to ggvis in R-markdown cause quit -
i'm trying use r-markdown shiny interactive visualization. file let user specify bunch of data files , use reactive shiny expression processed dataframe, data()
. can use data()
renderplot
correctly plot out bunch of graphs(like heatmap.2
, plot
). however, when try using ggvis
plot reactive data, generation of html quit @ ggvis code chunk. tried answer how data passed reactive shiny expression ggvis plot?. both of 2 methods in answer led "quitting lines". here's code:
reactive({ data %>% ggvis(~pcomp, ~variances) %>% layer_points()%>% layer_bars(fill := "gray", opacity := 0.5) %>% layer_lines() }) %>% bind_shiny("plot1") ggvisoutput("plot1")
here's code based on other method:
data %>% ggvis(~pcomp, ~variances) %>% layer_points()%>% layer_bars(fill := "gray", opacity := 0.5) %>% layer_lines()
i'm using r-studio version 0.99.441, r version 3.2.1 (2015-06-18), shiny_0.12.1, ggvis 0.4.
switched pure shiny , retried this, instead of using reactive
, wrapped whole thing in observe
. works perfectly.
Comments
Post a Comment