Create new dummy variable columns from categorical variable

后端 未结 8 1078
礼貌的吻别
礼貌的吻别 2020-11-28 04:03

I have a several data sets with 75,000 observations and a type variable that can take on a value 0-4. I want to add five new dummy variables to each data set f

8条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-28 04:39

    ifelse is vectorized, so if I understand your code correctly, you don't need that sapply. And I wouldn't use merge - I would use SQLite or PostgreSQL.

    Some sample data would help too :-)

提交回复
热议问题