Skip to content
Prev 236 / 585 Next

help

It sounds as if you are looking for something like

newvar <- as.numeric(var1=="yes")

or

newvar <- as.numeric(var1==1)

depending on whether var1 is numeric or character.

Best regards,
Bendix Carstensen