Skip to content
Prev 43537 / 398506 Next

for loops?

Hello Cathy

you should open some curly brackets after the "for" statement e.g.

for(i in 1:1000){
print("Hello!")
print(sum(15+i*3))
}

or simlarly. But please keep in mind that R is rather slow with loops.
So have a look at apply & friends and check if you can rephrase your
problem to use them.

cheers,

Winni
On Mon, 2004-02-02 at 14:42, Catherine Stein wrote: