Data: mpgVis • Chart ID: MotionChartID2fb48b55be2 • googleVis-0.5.8
R version 3.0.2 (2013-09-25) • Google Terms of Use • Documentation and Data Policy
R version 3.0.2 (2013-09-25) • Google Terms of Use • Documentation and Data Policy
library(googleVis)
library(ggplot2)
attach(mpg)
visColm<- paste(model,trans,displ,fl,sep=":")
mpgVisd<- data.frame("visColm"=visColm,"year"=as.numeric(year),
"manufacturer"=manufacturer, "model"=model,
"displ"=displ, "cyl"=cyl,"trans"=trans,
"drv"=drv, "cityMpg"= cty,"highwayMpg"= hwy,
"fl"=fl, "class"=class)
# Find duplicates - removes 11 rows
dup <- paste(visColm,mpg$year,sep=":")
dupind <- which(duplicated(dup)==TRUE)
mpgVis <- mpgVisd[-dupind,]
C<-gvisMotionChart(mpgVis,idvar="visColm",timevar="year")#,date.format="%Y")
plot(C)
print(C,file="googleVismpg.html")
detach(mpg)