我有这个data.frame:
Campanas1 variable sessions
1 Adwords sumResults 69
2 Campa�as sumResults 2
3 Directo sumResults 10947
4 Email sumResults 413
5 Referencias sumResults 12991
6 SEO sumResults 37693
7 Social Media sumResults 5993
8 Others sumResults 2
我用这段代码制作了一个条形图:
Sesiones_Campanas1 %>% ggvis(~Campanas1, ~sessions, fill := "red") %>% layer_bars()
问题:如何为每个/所有来源(来自 Campanas1)放置一个选择器?
我的尝试:
Sesiones_Campanas1 %>% ggvis(~Campanas1, ~sessions, fill := "red") %>% layer_bars(input_select(label = "Fuente"),
choices = c("Email",
"Directo", "Adwords",
"Campanas1", "Referencias", "SEO",
"Social Media"))
但我得到这个错误:
Error: length(x) not equal to 1