Created
September 21, 2012 18:37
-
-
Save bobthecat/3763136 to your computer and use it in GitHub Desktop.
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
library(xlsx) | |
library(googleVis) | |
# I downloaded the Excel file, cleaned the headers and worked a bit | |
# the column title. | |
da <- read.xlsx("~/Downloads/religion.xlsx", sheetName=1) | |
rownames(da) <- da$COUNTRY. | |
da <- da[,-1] | |
religion <- data.frame(country=rep(rownames(da), 3), | |
year=c(rep(2007, dim(da)[1]), rep(2009, dim(da)[1]), rep(2010, dim(da)[1])), | |
GRI=c(da$GRI_2007, da$GRI_2009, da$GRI_2010), | |
SHI=c(da$SHI_2007, da$SHI_2009, da$SHI_2010) | |
) | |
M <- gvisMotionChart(religion, idvar="country", timevar="year") | |
plot(M) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment