R googlVis运动图表的时间变量日期
这是我的密码:R googlVis运动图表的时间变量日期,r,date,google-visualization,R,Date,Google Visualization,这是我的密码: ages <- c("12", "13", "14", "15", "16", "17") #building a dataframe subjects <- rep(ages, 9) date <- c("2008-05-01","2008-06-01", "2008-07-01", "2008-08-01", "2008-09-01", "2008-10-01", "2008-11-01", "2008-12-01", "2009-01-01
ages <- c("12", "13", "14", "15", "16", "17") #building a dataframe
subjects <- rep(ages, 9)
date <- c("2008-05-01","2008-06-01", "2008-07-01", "2008-08-01", "2008-09-01", "2008-10-01", "2008-11-01", "2008-12-01", "2009-01-01")
date.class <- as.Date(rep(date, rep(6, length(date))))
val1 <- rnorm(54)
val2 <- rnorm(54)
val3 <- rnorm(54)
val4 <- rnorm(54)
DF <- data.frame(Subject = subjects,
Date = date.class,
Val1 = val1,
Val2 = val2,
Val3 = val3,
Val4 = val4)
library(googleVis)
M <- gvisMotionChart(DF, idvar = "Subject", timevar = "Date")
plot(M)
年龄