What was a For loop? Why isn't it needed in R?

62 Views Asked by At

In the R FAQ's section about comparing S and R, we find the following:

In R, For() loops are not necessary and hence not supported.

What was a For() loop and why does R not need it?

1

There are 1 best solutions below

0
On BEST ANSWER

There is a copy of S-PLUS: Programmer’s Guide online. Pages 647-648 contrast for and For loops. The S-Plus manual generally discourages using for loops (pp. 120, 639-641) and encourages apply family approaches, but R has optimized for loops to the point that those recommendations are now moot and the "optimized" For loop is no longer necessary.