在R语言中有一个dygraphs的包,可以添加注释:https://rstudio.github.io/dygraphs/gallery-annotations.html
dygraph(presidents, main = "Quarterly Presidential Approval Ratings") %>%
dyAxis("y", valueRange = c(0, 100)) %>%
dyAnnotation("1950-7-1", text = "A", tooltip = "Korea") %>%
dyAnnotation("1965-1-1", text = "B", tooltip = "Vietnam")
我想知道如何创建一个数据框来组织所有的注释并通过单个的dyAnnotation选项添加。我尝试过:
dygraph(presidents, main = "Quarterly Presidential Approval Ratings") %>%
dyAxis("y", valueRange = c(0, 100)) %>%
dyAnnotation(c("1950-7-1","1965-1-1"), text = c("A","B"), tooltip = c("Korea","Vietnam"))
它不能工作。