However, it's been a while, so today I thought I'd take advantage of the release of googleVis. Quick attempts to make to draw time series were quite nice. It may not be as configurable as ggplot, but it's very nice and rather easy to use:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param<-data.frame(ID=c('a','b'), M=c(1,5), Q=c(2,-3)) | |
curves<-data.frame(ID=rep(param$ID, 100), time=sort(rep(0:99,2))) | |
curves$y<- param$Q+sin(curves$time/param$M) | |
plot(gvisMotionChart(curves, idvar = 'ID', x = 'time', y='y', options = list(width = 1500, height = 900))) |
Hopefully I'll figure out how to upload a live version for anyone to play with it... Any hint?
The easiest way to include googleVis output in your post is via the the iframe tag. Place the HTML output file from googleVis in a public folder and link to it in your post using the iframe tag. The googleVis package vignette has a section on this, see also slides 34 - 36 of the googleVis tutorial: http://decastillo.github.io/googleVis_Tutorial/#34
ReplyDeleteThanks!!!
Delete