[R] Counting the loop-round of a "for"-loop

538280 at gmail.com 538280 at gmail.com
Tue Feb 14 03:27:25 CET 2012


Consider using sapply instead of a for loop, if the code in the sapply
call returns a vector, and every vector is the same length, then
sapply will automatically form it into a matrix for you.

On Sun, Feb 12, 2012 at 12:30 PM, jolo999 <jonas.lorson at ebs.de> wrote:
> It seems to work. Simple and effective!
>
> Thanks!
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Counting-the-loop-round-of-a-for-loop-tp4381319p4381780.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.



-- 
Gregory (Greg) L. Snow Ph.D.
538280 at gmail.com



More information about the R-help mailing list