Skip to content

Premature conversion of factors to numeric #168

@goergen95

Description

@goergen95

I think that the conversion of factor variables to numeric before applying aoa() causes unintended treatment of categorical variables as numeric. In fact, conversion to dummy variables is intended to happen within aoa() which should not trigger if converted to numeric early.
(CC: @Nowosad)

CAST/R/aoa.R

Lines 187 to 188 in 716a035

if (any(is.factor(newdata)))
newdata[[which(is.factor(newdata))]] <- as.numeric(newdata[[which(is.factor(newdata))]])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions