On 07/17/2012 11:55 PM, cm 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
Elementary, my dear cm. pos is a vector of length n. From your
description of the problem, I suspect that you are trying to run a loop
that looks something like this:
for(o in 1:n)) {
if(round(pos[o+1]) == (pos[o+1]-0.4))
print(o)
}
The error occurs on the nth loop. The additional clue that you have
unwittingly provided in the form of the number 65 that shouldn't be
there brings me to the conclusion that n=65.
Jim
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.