我正在尝试使用googleVis
程序包来绘制数据,但出现以下错误:
Error in gvisCheckMotionChartData(data, my.options) :
The data must have rows with unique combinations of idvar and timevar.
Your data has 3079 rows, but idvar and timevar only define 8 unique rows.
head(mydata)
created lic plan category type count Month Year Week
1 2018-07-01 1 3 Success REC 1 July 2018 July-WEEK-1
2 2018-07-01 1 3 Success IMP 1 July 2018 July-WEEK-1
3 2018-07-01 1 3 Com IMP 1 July 2018 July-WEEK-1
4 2018-07-01 1 4 Mrk REC 2 July 2018 July-WEEK-1
5 2018-07-01 1 4 Mrk IMP 1 July 2018 July-WEEK-1
6 2018-07-01 1 4 Mrk REC 1 July 2018 July-WEEK-1
帮助我找到解决方案,我想像下面的示例一样进行绘图:
library(googleVis)
data("Fruits")
mychart<-gvisMotionChart(Fruits,idvar = "Fruit","Year")
plot(mychart)