Duncan Murdoch wrote: > On 21/09/2007 6:54 PM, Evan Cooch wrote: >> Thanks, but there is nothing in section 9.2.2 that mentions >> seq(x,y,z) or anything close in a for loop. All it says is (basically): >> >> >> There is also a for loop construction which has the form >> > for (name in expr_1) expr_2 >> where name is the loop variable. expr 1 is a vector expression, >> (often a sequence like 1:20), and >> expr 2 is often a grouped expression with its sub-expressions written >> in terms of the dummy >> name. expr 2 is repeatedly evaluated as name ranges through the >> values in the vector result of >> expr 1. >> >> Moreover, I would have assumed it would be in the language definition >> file (not that I could find - I did check), > > You seem to be assuming the language is different than it is. To do > the loop you want, you construct the vector of values you want to loop > over, and loop over it. There's no specific syntax for that, because > there's no need for it. There's just a for loop that loops over a > general vector. You can put anything you want in that vector. > > Point being, the documentation makes the implicit assumption that the new user will immediately recognize that the argument is a vector, and how to specify the sequence over the vector. This is a good example of what I call obtuse documentation (having written ~1100 pages of documentation for various opensource programs, I'm sort of sensitive to this).
Regardless, thanks for your help. ______________________________________________ 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.