On Jul 12, 2009, at 3:35 PM, David Winsemius wrote:
On Jul 12, 2009, at 2:53 PM, Mark Knecht wrote:
As a test I tried to print down to the string "(all)" and then
break but this code and everything I've tried so far is terribly
wrong. Every attempt prints lots of error messages. I'm not grasping
at all what I'm doing wrong or what's the right way to do this sort
of
thing. Clearly my first for loop isn't a success!
for(n in SystemResults$EnTime) {
if(SystemResults$EnTime[n] == "(all)") break)
Inside the loop, shouldn't you be comparing to "n"?? As you have it
now, the values of that factor are probably being used as indices to
itself. (Not good.) Also not good is the use of "break". It looks
to be fairly severely deprecated at this point
Appears I am wrong about this. I was basing my assumption on this
interaction with the R interpreter:
> ?break
Error in genericForPrimitive(f) :
methods may not be defined for primitive function "break" in this
version of R
But:
?Control ... suggests that break-ing out of for loops remains
acceptable.
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
______________________________________________
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.