Created
June 11, 2012 14:41
-
-
Save ramnathv/2910395 to your computer and use it in GitHub Desktop.
OECD Analysis: Simplified Code
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
#' Clean numerical data by removing | |
clean <- function(var){ | |
type.convert(gsub("[a-zA-Z\\%\\s]", "", var)) | |
} | |
oecd[,-1] <- sapply(oecd[,-1], clean) | |
x <- oecd[,-c(1, NCOL(oecd))] | |
y <- oecd[,NCOL(oecd)] | |
plyr:::adply(x, 2, cor, y, use = 'complete.obs') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment