Disappearing values in ggvis when using tooltip on grouped data
问题 This works fine library(dplyr) library(ggvis) years <- as.factor(c(2013,2013,2014,2014,2015,2015)) months <- c(1,2,1,2,1,2) values <- c(3,2,4,6,5,1) df <- data.frame(years,months,values) df %>% group_by(years) %>% ggvis(~months, ~values) %>% layer_points( fill = ~years) However, when I add a tooltip the points all appear momentarily but only the 2015 values remain df <- cbind(df, id = seq_len(nrow(df))) all_values <- function(x) { if(is.null(x)) return(NULL) row <- df[df$id == x$id,] paste0