[R] Avoiding another loop

Michael Roberts mroberts at ers.usda.gov
Mon Jan 29 18:46:42 CET 2001


Hello,

Is there a fancy way I can use a function (like apply)
to avoid a the follwoing loop, or otherwise make this more
efficient?  It fills a 3-d array, one matrix at a time.
"nsize" is big, and efficiency is important. 

for (i in 1:nsize) simy[,,i] <- myfunction(p1,p2, ...)

Thanks!



Michael J. Roberts
Resource Economics Division, PMT
USDA-ERS
202-694-5557
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list