Skip to content
Prev 161339 / 398503 Next

missing value where TRUE/FALSE needed

They may be the same length; that's not what the error message is 
complaining about:  it says there is a missing value (i.e., an NA) where 
a TRUE/FALSE value is needed, therefore the 'if' doesn't know what to 
do, since it is not TRUE or FALSE. So, try

summary(vector1)
summary(vector2)

sum(is.na(vector1))
sum(is.na(vector2))

to see if/where/why there are NAs in these vectors.
David Croll wrote: