Skip to content

Instantly share code, notes, and snippets.

@ZeccaLehn
Created August 31, 2015 17:21
Show Gist options
  • Save ZeccaLehn/d9cf4defaf417f0f6d30 to your computer and use it in GitHub Desktop.
Save ZeccaLehn/d9cf4defaf417f0f6d30 to your computer and use it in GitHub Desktop.
[R] Class of Each Feature via Iteration -- from a Data.Table Object
library(data.table)
trainRaw <- fread("train.csv", header = TRUE, sep = ",")
classVec <- NULL
for(i in 1:length(names(trainRaw))){
classVec[i] <- class(unlist(trainRaw[, i, with=F]))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment