自更新到ggvis 0.4以来过滤器出错

时间:2015-03-02 07:59:08

标签: r plot ggplot2 statistics ggvis

我最近更新了ggvis,当我在我的某个地块中使用filter时,我现在收到错误消息。错误是:

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

我的代码如下所示:

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

这是一个可重复的例子:

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")))

0 个答案:

没有答案