If I run fread specifying na.strings is this not respected by stringsAsFactors? I see in the code that as.factor is called without the exclude= argument.
I'm asking because I get factors with NA as one of the levels. This means DT[is.na(factorcol),] returns no rows which is not what I was expecting. The workaround it to use DT[is.na(levels(factorcol)),]
If I run
freadspecifying na.strings is this not respected by stringsAsFactors? I see in the code thatas.factoris called without theexclude=argument.I'm asking because I get factors with
NAas one of the levels. This meansDT[is.na(factorcol),]returns no rows which is not what I was expecting. The workaround it to useDT[is.na(levels(factorcol)),]