[R] TRUE/FALSE

Sarah Goslee sarah.goslee at gmail.com
Tue Jul 17 17:57:18 CEST 2012


What's pos?
What's o?
What is your loop looping over?
Where's your reproducible example provided using dput()?

And more generally, have you read R FAQ 7.31 and the posting guide?

Most likely either o is wrong, or there are NA values in pos, but we
have no way to diagnose that.

Sarah

On Tue, Jul 17, 2012 at 9:55 AM, cm <bunnylover23 at optonline.net> wrote:
> Any reason I'd get an error like this?
>
> Error in if (round(pos[o + 1]) == (pos[o + 1] - 0.4)) { :
>   missing value where TRUE/FALSE needed
>
> but when i do it individually, out of the for loop,
>> (round(pos[o+1])==(pos[o+1]-.4) )
>   65
> TRUE
>

-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list