It's hard enough to get the leading space in the column name. "Random coding" shall not occur. On the other hand, I donβt see a very large error checking in the fread code, therefore, perhaps until this unwanted behavior is fixed (or the function request is rejected), you can do something like this:
setnames(DT, make.names(colnames(DT)))
If, on the other hand, it bothers you that colnames(DT) will display the column names with quotation marks, then simply "survive." The way the interactive console displays any character value.
If you have a data item in the character column that looks like " ttt" in the original, then it will have leading spaces when importing, and you need to handle it with colnames(dfrm) <- sub("^\\s+", "", colnames(dfrm)) or one of several trim functions in different packages (for example, "gdata")
42-
source share