Skip to content

ds.asFactor when generating dummy variables, avoid generic DV prefix #380

@tombisho

Description

@tombisho

If you want to create dummy variables for multiple factor variables which both have levels 1,2,3 then both of these have the dummy variables DV2 and DV3. This makes it harder to recombine these back into a data frame as there is duplication of column names. It is not trivial to change column names

I recommend using the variable name as the default prefix and allowing the user to specify their own if they want.

For example for EDU_LEVEL and INCOME_LEVEL the dummy variables would be EDU_LEVEL_2, EDU_LEVEL_3 and INCOME_LEVEL_2 and INCOME_LEVEL_3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions