lundi 2 août 2021

Evaluating multiple conditions in an IF function in R

I just have a quick question about evaluating multiple conditions in an IF statement in R.

I want to use something like:

IF(is.na(a[i]) == FALSE & b[i] == c[i]){output[i]=b[i]}

...

IF(is.na(x[i]) == FALSE & y[i] == c[i]){output[i]=y[i]}

But when I go to run it, it tells me "missing value where TRUE/FALSE needed"

I assume this doesn't like me running the last part, but I need to evaluate if those values are equal. Any suggestions or ideas?

Thanks!!

Aucun commentaire:

Enregistrer un commentaire