fread - read all columns as character
Your colClasses
argument is in the wrong place. It needs to be inside fread()
, not inside data.frame()
. Try this:
prop1 <- data.frame(fread("C:\\myFile.csv",
colClasses = c(rep("character", 58))),
stringsAsFactors = FALSE)
More canonical use of data.table
to accomplish this would be:
prop1 <- fread("C:\\myfile.csv", colClasses = 'character', data.table = FALSE)
simply put:
colClasses=c("character")