I am running S-Plus 2000 professional on Windows 98
Generally speaking, if I have nested "for" loops,
i.e.
for(i in 1:n){
..stufff...
vector[i] <- function(i, x) { vector[j] <- for(j in 1:m)
function(i, x, j) }
}
I am better of using lapply for both, for the outer loop or the inner
loop?
Most of the work is done by the inner for loop. It, the inner loop,
calculates thousands of means (j=1:12,000) for each i although i =
1:12,000 as well.
I have read the programmer's manual etc., but as a Novice programmer, I
can be a little thick. Any thoughts are wlecome. I will be upgrading to
version 6 of Splus next year, so if the answer is version dependent, I'd
appreciate both answers.
TIA,
Henry
--
Dr. M. Henry H. Stevens
Postdoctoral Associate
Department of Ecology, Evolution, & Natural Resources
14 College Farm Road
Cook College, Rutgers University
New Brunswick, NJ 08901-8551
email: hstevens@rci.rutgers.edu
phone: 732-932-9631
fax: 732-932-8746
|