dimanche 9 septembre 2018

Make third column conditional on two others in R studio

I'm relatively new to R, and I'm playing around with it to get better. simple question:

I have two columns with true/false represented as 1/0 respectively I want to make a third column that has true/false, again represented as 1/0, being true if both of the first two columns are true

so with this example dataset, if a and b BOTH equal 1, how would I get column c to have a value of 1 as well?

a b c

1 1 1

1 0 0

0 1 0

Aucun commentaire:

Enregistrer un commentaire