Skip to content

Instantly share code, notes, and snippets.

@sizhky
Last active May 22, 2017 12:06
Show Gist options
  • Save sizhky/d303ea7b60281b6303c31e0f3ec91da2 to your computer and use it in GitHub Desktop.
Save sizhky/d303ea7b60281b6303c31e0f3ec91da2 to your computer and use it in GitHub Desktop.
datatypes <- function(dataframe){
types <- split(names(dataframe),sapply(dataframe, function(x) paste(class(x), collapse=" ")))
return(types)
}
factor_cols <- c()
raw_data[,factor_cols] <- lapply(raw_data[,factor_cols],
function(x) factor(x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment