vendredi 6 novembre 2020

is ifelse test with several different positive outcomes posible?

I'm trying to create a new column with 1/0 values depending on the value of another column. I have tried the following, but i keep getting all 0's

NPT$Vådt=ifelse((NPT$Feltnummer == 25 | 28 | 29 | 32 | 42 | 43 | 44 | 47 | 54 | 55 | 56 | 58 | 59 | 60 | 61 | 63 | 64 | 65 | 68),1,0)

How would i go about doing this?

Aucun commentaire:

Enregistrer un commentaire