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?
https://github.com/noamross/zero-dependency-problems/blob/master/R/many-dichotomous-variables.md