Skip to content
Prev 43533 / 398506 Next

for loops?

On Mon, 2004-02-02 at 13:42, Catherine Stein wrote:
Hello.

I believe you want something like:

for(i in 1:n){
...some lines here...
}

If you have only one line within the for loop you can use it without the
brackets.

If the environment is still open (as within the for loop) you will not
get a new ">" prompt but a "+" prompt to continue as if you were writing
on the same line.

Only when you close the brackets the prompt will return to ">" after
executing the for loop.

Hope this will help.

Pedro