I have seen this asked elsewhere, but I cannot figure out how to implement so my situation.
I have a data frame with 30 variables. Two of the variables are factors that have over 100 levels. I am doing a RandomForest, so I need to convert 1 variable with 100 factors to 100 dummies variables.
Normally I use the iflse to create dummy, but do not want to code 100 new variables manually.
My variable is Car$Model (a factor with 100 levels).
I want some like this created and inserted into the dataframe with a 1/0:
Car$Model1
Car$Model2
Car$Model3
...
Car$Model100