jeudi 30 septembre 2021

If else statements between multiple variables R

I have a set of dummy variables for yes no questions. I want to extract numeric values to another new variable based on these questions. for example: first questions are as:

do you accept the amount 1€(Yes/No) do you accept the amount 2€(Yes/No) do you accept the amount 3€(Yes/No)

then I should extract the numeric answers to another new variable. so how can I use that ifelse function for this kind of coding ?

thank you in advance,

Aucun commentaire:

Enregistrer un commentaire