This question already has an answer here:
I'm running through someone else's R code while they are on vacation. To my knowledge, this code has always worked before, and I've seen them run it successfully. When I run it, I have an unexpected error with this line:
AllZero <- if ( length(unique(x==0)) > 1 ) {FALSE} else if (unique(x==0) == TRUE) {TRUE} else {FALSE}
The error returned is:
Error in if (unique(x == 0) == TRUE) { : missing value where TRUE/FALSE needed
My cursory search indicates this syntax is okay. This is part of a function which is in turn part of a very, very large set of procedures. I'm not sure if this function is now being called in an unexpected way (or perhaps has not been called previously) because the underlying data changed.
Am I missing something very obvious?
Aucun commentaire:
Enregistrer un commentaire