[R] sapply and loop

Mayeul KAUFFMANN mayeul.kauffmann at tiscali.fr
Sat Oct 16 11:50:39 CEST 2004


Zhen,

>how to count the exact time ?

system.time(base)
Returns CPU (and other) times that expr used.


If you only need seconds, you can also do

date();zz<-sapply(ma, myfunction);date()

I do not know about how to reduce the time.
For very comlex iterations, I use for( ) myself, which maybe inneficient.

Mayeul KAUFFMANN
Université Pierre Mendès France
Grenoble
France




More information about the R-help mailing list