Closed GoogleCodeExporter closed 8 years ago
## I can confirm that I get the same message:
M <- gvisMotionChart(data, idvar = "choice", timevar="time")
## Error in gvisCheckMotionChartData(data, my.options) :
## The data must have rows with unique combinations of idvar and timevar.
## Your data has 40 rows, but idvar and timevar only define 10 unique rows.
head(data)
## time choice
## 1 2011-12-15 Option 1
## 2 2011-12-15 Option 2
## 3 2011-12-15 Option 1
## 4 2011-12-15 Option 2
## 5 2011-12-15 Option 2
## 6 2011-12-15 Option 1
##
## Your data set has, as the error message suggest several values for the same
date.
## For 2011-12-15 Option 1 appears several times.
## A motion chart requires unique rows for each 'idvar' / 'timevar'
combination.
## Further, a value to plot is missing.
## I suggest that you aggregate your data to a day level first.
##
## Here is an extended example which works for me:
df=unique(data)
df$value=rnorm(nrow(df))
M <- gvisMotionChart(df, idvar = "choice", timevar="time")
plot(M)
## Your observation is as expected.
## Please let me know if we can improve the documentation.
Original comment by markus.g...@googlemail.com
on 21 Dec 2011 at 9:05
Yes, I've already solved the problem. I had to make my data matrix as follows:
time choice quantity
date1 Option 1 Sum_of_Option 1_occurancies_on_date1
date1 Option 2 Sum_of_Option 2_occurancies_on_date1
date2 Option 1 Sum_of_Option 1_occurancies_on_date2
date2 Option 2 Sum_of_Option 2_occurancies_on_date2
...
Now have the graph:
http://masscom.ucoz.ua/test.html
Original comment by dr.zan...@gmail.com
on 21 Dec 2011 at 9:14
I am glad to hear that you could solve your issue.
Original comment by markus.g...@googlemail.com
on 21 Dec 2011 at 10:08
Original issue reported on code.google.com by
dr.zan...@gmail.com
on 21 Dec 2011 at 8:39