Reputation: 113
I'm having issues getting GoogleVis to work. When I plot using GoogleVis, I get a blank browser. Here's what I did:
Warning message: In if (class(x[[.x]]) == "Date") as.character(x[[.x]]) else x[[.x]] : the condition has length > 1 and only the first element will be used
I expected a motion chart, but I just got a blank browser. I also tried converting the 'Time' column from a numeric to date class, but no luck.
I'm using R 3.0.2, Mac OS X version 10.6.8 and Safari Version 5.1.2 (6534.52.7). I also ran the the same code on my work Windows laptop, but no luck.
Any feedback would be greatly appreciated! Thanks!
Upvotes: 2
Views: 2625
Reputation: 3110
The full error that you got after typing:
mchart1<-gvisMotionChart(ChickWeight1,idvar='weight',timevar='Time')
was:
Error in gvisCheckMotionChartData(data, my.options) :
The data must have rows with unique combinations of idvar and timevar.
Your data has 578 rows, but idvar and timevar only define 375 unique rows.
In addition: Warning message:
In if (class(x[[.x]]) == "Date") as.character(x[[.x]]) else x[[.x]] :
the condition has length > 1 and only the first element will be used
This error would have clued you in to the fact that you hadn't designated the ids of the chicks. If you do mchart1<-gvisMotionChart(ChickWeight,idvar='Chick',timevar='Time')
This will give you the motion plot of how the chicks gain weight over time.
?gvisMotionChart
is very useful.
Upvotes: 3