googleVis!!!
[This article was first published on gRaphics!, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
I’m back working on R&graphics at last. I’ve made some progress on the shiny+rgl front, but haven’t really had the time to create anything which could be posted here… Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
However, it’s been a while, so today I thought I’d take advantage of the release of googleVis (www.r-bloggers.com/googlevis-0-5-5-released/). 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?
To leave a comment for the author, please follow the link and comment on their blog: gRaphics!.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.