Skip to content

NA values with stringsAsFactors = true #1466

@JamesOwers

Description

@JamesOwers

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)),]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions