我正在尝试在ggvis中创建一个条形图,您可以将其悬停在其元素上并查看每个条形图所代表的数字。
range <- rep(c("0","1","2", "4"),2)
gender <- rep(c("male", "female"),4)
value <- runif(8)
df <- data.frame(Range = range, Gender = gender, Value = value)
df%>% ggvis(~Range, ~value) %>%
layer_bars(width =.1 ,fill = ~gender)
当我将鼠标悬停在元素上时,如何让元素显示值和性别?如何让条形图彼此相邻而不是堆叠?