ggvis icon indicating copy to clipboard operation
ggvis copied to clipboard

Cannot add layer_smooths() when x or y is interactively selected

Open taekyunk opened this issue 9 years ago • 4 comments

I looked at vignettes but I did not find a way to make this works. I can use shiny in this case, but it would be great if this can be done with ggvis alone.

library(ggvis)
library(dplyr)

# works
mtcars %>% 
    ggvis(~mpg, ~wt) %>% 
    layer_smooths()

# does not work
mtcars %>% 
    ggvis(~mpg, input_select(names(mtcars), map = as.name)) %>% 
    layer_smooths()
# Error: Visual property y.update is not a variable

# works
mtcars %>% 
    ggvis(~mpg, input_select(names(mtcars), map = as.name)) %>% 
    layer_points()

# does not work
mtcars %>% 
    ggvis(~mpg, input_select(names(mtcars), map = as.name)) %>% 
    layer_points() %>%
    layer_smooths()
# Error: Visual property y.update is not a variable

I am using Rstudio 0.98.1103 and the session info is as follows

> sessionInfo()
R version 3.1.3 (2015-03-09)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] shiny_0.11.1     dplyr_0.4.1.9000 ggvis_0.4.1.9000

loaded via a namespace (and not attached):
 [1] assertthat_0.1       DBI_0.3.1            digest_0.6.8         htmltools_0.2.6     
 [5] httpuv_1.3.2         jsonlite_0.9.15      lazyeval_0.1.10.9000 magrittr_1.5        
 [9] mime_0.3             parallel_3.1.3       R6_2.0.1             Rcpp_0.11.5         
[13] RJSONIO_1.3-0        rstudio_0.98.1103    rstudioapi_0.3.1     tools_3.1.3         
[17] xtable_1.7-4        

taekyunk avatar Apr 13 '15 15:04 taekyunk

Experiencing the same issue

voxnonecho avatar Mar 17 '16 02:03 voxnonecho

Same here, using layer_model_predictions or layer_smooths.

whiteplastic avatar Apr 06 '16 07:04 whiteplastic

Same here. But it seems like nobody is providing a solution for this problem, or ggvis is abandoned?

Masood87 avatar Aug 23 '18 09:08 Masood87

Same issue when trying to use layer_boxplots()

gustavo-hideo avatar Oct 02 '18 18:10 gustavo-hideo