Skip to content

Instantly share code, notes, and snippets.

@ramnathv
Created June 11, 2012 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramnathv/2910395 to your computer and use it in GitHub Desktop.
Save ramnathv/2910395 to your computer and use it in GitHub Desktop.
OECD Analysis: Simplified Code
#' 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