Skip to content

many-dichotomous-variables #12

@noamross

Description

@noamross

https://github.com/noamross/zero-dependency-problems/blob/master/R/many-dichotomous-variables.md

I have a dataframe with around 8000 rows. Variable X is a categorical variable with values ranging from 1 to 200. I want to create 200 dichotomous variables (0/1) based on X.

Thus X001 == 1 if X == 1; & X001 == 0 if X !=1. Any suggestions how to do this?

Thanks for your time.

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