On 7/4/2008 8:04 AM, Eric Ferreira wrote:
Dear useRs

How can I stop a loop without printing the 'error' message (givin by stop()
, for instance) ?

Just put in a break statement, e.g.

> for (i in 1:100000) {
+   print(i)
+   if (i > 5) break
+ }
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
>

Duncan Murdoch

______________________________________________
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.

Reply via email to