ggvis 0.4 can't pass string list to filter anymore

75 views
Skip to first unread message

Jack Simpson

unread,
Mar 2, 2015, 8:47:51 PM3/2/15
to gg...@googlegroups.com
I recently updated ggvis and I am now getting an error when I use filter in one of my plots. The error is:

    "Error in filter(., area %in% eval(input_checkboxgroup(unique(rel_data$area),  : (list) object cannot be coerced to type 'double'"

Here's a reproducible example:

    names = c("Bacilli", "Actinobacteria", "area")
    b_counts <- c(1,5,8,100,34)
    a_counts <- c(1,3,11,55,67)
    area <- c("Gut", "Skin", "Gut", "Gut", "Skin")
    rel_data <- data.frame(b_counts, a_counts, area)
    names(rel_data) <- names

    library(ggvis)

    rel_data %>% ggvis(x = input_select(names(rel_data[,-3]), map = as.name, label = "X Axis"), 
                   y = input_select(names(rel_data[,-3]), map = as.name, label = "Y Axis")) %>%
      filter(area %in% eval(input_checkboxgroup(unique(rel_data$area), selected = "Gut")))

*Changed old post so I could include a reproducible example

Jack Simpson

unread,
Mar 5, 2015, 6:06:21 PM3/5/15
to gg...@googlegroups.com
So far I've had some people say that they can get this code to run, so I'm starting to think this might be a bug with Mac Yosemite.

Brandon Hurr

unread,
Mar 5, 2015, 6:14:55 PM3/5/15
to Jack Simpson, gg...@googlegroups.com
I get the same error in Mavericks (10.10.3). 

R version 3.1.2 (2014-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] ggvis_0.4.0.9000

loaded via a namespace (and not attached):
 [1] assertthat_0.1  DBI_0.3.1       digest_0.6.8    dplyr_0.4.1     htmltools_0.2.6 httpuv_1.3.2   
 [7] lazyeval_0.1.10 magrittr_1.5    mime_0.2        parallel_3.1.2  R6_2.0.1        Rcpp_0.11.4    
[13] RJSONIO_1.3-0   shiny_0.11.1    tools_3.1.2     xtable_1.7-4   

--
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.

Jack Simpson

unread,
Mar 5, 2015, 6:17:19 PM3/5/15
to gg...@googlegroups.com, jackbruc...@gmail.com
Thanks for letting me know! I'm going to try test this on a Linux and Windows machine later this afternoon, still trying to get the people who say it worked to tell me which OS they're using.

Peter Ellis

unread,
Mar 30, 2015, 2:49:39 PM3/30/15
to gg...@googlegroups.com
Does the problem go away if you add

library(dplyr)


?

Jack Simpson

unread,
Mar 30, 2015, 8:09:48 PM3/30/15
to gg...@googlegroups.com
It does!!!!!! Thank-you so much! I was tearing my hair out for ages about that!
Reply all
Reply to author
Forward
0 new messages