structure(list(Date = c("2013-11-17", "2013-11-18", "2013-11-19",
"2013-11-20", "2013-11-21", "2013-11-22", "2013-11-23", "2013-11-25",
"2013-11-26", "2013-11-27", "2013-11-28", "2013-11-29", "2013-11-30",
"2013-12-02", "2013-12-03", "2013-12-04", "2013-12-05", "2013-12-06",
"2013-12-07", "2013-12-09", "2013-12-10", "2013-12-11", "2013-12-12",
"2013-12-13", "2013-12-14", "2013-12-16", "2013-12-17", "2013-11-17",
"2013-11-18", "2013-11-19", "2013-11-20", "2013-11-21", "2013-11-22",
"2013-11-23", "2013-11-25", "2013-11-26", "2013-11-27", "2013-11-28",
"2013-11-29", "2013-11-30", "2013-12-01", "2013-12-02", "2013-12-03",
"2013-12-04", "2013-12-05", "2013-12-06", "2013-12-07", "2013-12-09",
"2013-12-10", "2013-12-11", "2013-12-12", "2013-12-13", "2013-12-14",
"2013-12-16", "2013-12-17"), Catagory = structure(c(1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L), .Label = c("build", "client"), class = "factor"),
User_Name = c(1L, 4L, 6L, 6L, 5L, 7L, 5L, 5L, 3L, 5L, 2L,
4L, 5L, 2L, 3L, 2L, 2L, 5L, 5L, 7L, 3L, 4L, 3L, 4L, 3L, 2L,
2L, 1L, 5L, 6L, 6L, 6L, 7L, 5L, 5L, 3L, 5L, 2L, 4L, 5L, 1L,
6L, 4L, 5L, 4L, 6L, 5L, 12L, 4L, 4L, 3L, 5L, 5L, 3L, 3L),
type = c("obj1", "obj1", "obj1", "obj1", "obj1", "obj1",
"obj1", "obj1", "obj1", "obj1", "obj1", "obj1", "obj1", "obj1",
"obj1", "obj1", "obj1", "obj1", "obj1", "obj1", "obj1", "obj1",
"obj1", "obj1", "obj1", "obj1", "obj1", "obj2", "obj2", "obj2",
"obj2", "obj2", "obj2", "obj2", "obj2", "obj2", "obj2", "obj2",
"obj2", "obj2", "obj2", "obj2", "obj2", "obj2", "obj2", "obj2",
"obj2", "obj2", "obj2", "obj2", "obj2", "obj2", "obj2", "obj2",
"obj2")), .Names = c("Date", "Catagory", "User_Name", "type"
), row.names = c(NA, 55L), class = "data.frame")
使用以下代码生成路径图,以随时间比较两个不同的变量。
library(rCharts)
econ <- transform(dat, Date = as.character(Date))
attach(econ)
pic<-rPlot(x="Date",y=c("User_Name"),color="type",data=econ,type="line")
即使该情节应该是交互式的,但没有任何迹象表明它像tootip功能和所有。我不知道如何在 ggplot2 中添加交互性,这就是我计划使用 rCharts 进行简单交互的原因。如果可能的话,谁能告诉我如何在 rCharts 和 ggplot2 中做到这一点。不管怎么说,还是要谢谢你。