dimanche 7 mai 2017

Assign values to new column if condition is met in at least one of the selected columns

Here's the problem: I have an empty column "x", which should take value 1 if number "3210" appears in any of the columns from 11th to 32nd, otherwise x=0.

Due to the large number of columns, I cannot use "ifelse" to check if 3210 appears column by column. is there a simpler way?

Thanks.

Aucun commentaire:

Enregistrer un commentaire