mardi 30 juin 2015

How to make an ifelse statement for each row in a table

I'm trying to make an ifelse statement giving a result for each row in a table with undefined rows based on certain columns. I have tried to do following: (phyto is the name of my data set)

l=ifelse((Phyto[,8]!="" && Phyto[,2]!="" && Phyto[,9]!="" && Phyto[,3]!="" && Phyto[,1]!=""),0,1)

However, the result does not come from each row but from the entire table.

Does anyone has a suggestion for the problem?

Aucun commentaire:

Enregistrer un commentaire