tush1r / google-motion-charts-with-r

Automatically exported from code.google.com/p/google-motion-charts-with-r
0 stars 0 forks source link

motion chart time range doubled, data repeated in reverse #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

in R:

groups <- c(rep('a',1000),rep('b',1000),rep('c',1000))
times <- 1:1000
values <- 1000:1
myFrame <- data.frame(groups=groups,times=times,values=values)
Motion <- gvisMotionChart(myFrame,idvar="groups",timevar="times")
plot(Motion)

What is the expected output? What do you see instead?

I would expect the range to vary from 1 to 1000, instead it goes from 1 to 
1999.  I would expect the points to move from the upper right to lower left, 
which they do, but they they move back up, as if the entire data set was 
repeated, backwards

What version of the product are you using? On what operating system?
R version 2.13.0 (2011-04-13) • googleVis-0.2.4  On Mac OSX

Please provide any additional information below.

When I look at the code for the chart, the data in the JSON part does not 
repeat, and there are no time values larger than 1000

Original issue reported on code.google.com by skyeb...@gmail.com on 21 Apr 2011 at 1:59

GoogleCodeExporter commented 9 years ago
Issue doesn't seem to happen if I shift the range of the time values +1000 so 
they are more like years,  perhaps it is mistakenly converting numeric values 
to dates?

Original comment by skyeb...@gmail.com on 21 Apr 2011 at 8:22

GoogleCodeExporter commented 9 years ago
The Google Visualisation API interprets a numeric value of 1 in timevar as 1901 
and not as year 1; equally it will only accept date from 0/1/01/1900 onwards
Here is a simple examples:

library(googleVis)
plot(gvisMotionChart(Fruits, "Fruit", "Year"))
Fruits[1,2]=1
plot(gvisMotionChart(Fruits, "Fruit", "Year"))

Fruits$Date[1]="0-01-01"
plot(gvisMotionChart(Fruits, "Fruit", "Date"))

Original comment by markus.g...@googlemail.com on 25 Apr 2011 at 3:47

GoogleCodeExporter commented 9 years ago
It appears that years greater 100 are accepted without problems.
So could it be that years before 100 (two digits) are interpreted as 19XX?

Original comment by markus.g...@googlemail.com on 26 Apr 2011 at 7:49

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I have added a note to the help file of gvisMotionChart:
 Please notice that a \code{timevar} with values less than 100 will be shown as years 19xx.

Original comment by markus.g...@googlemail.com on 26 May 2011 at 8:14