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?
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?
Copyright © 2021 Jogjafile Inc.
There is a copy of S-PLUS: Programmer’s Guide online. Pages 647-648 contrast
for
andFor
loops. The S-Plus manual generally discourages usingfor
loops (pp. 120, 639-641) and encouragesapply
family approaches, but R has optimizedfor
loops to the point that those recommendations are now moot and the "optimized"For
loop is no longer necessary.