On Wed, 2 Jun 2004, Peter Dalgaard wrote:
> "Wolski" <[EMAIL PROTECTED]> writes:
>
> > list3[[x]] <- myfunc(list1[[x]],list2[[x]])
> >
> > Until now I am runnign this in a for(x in 1:length(list1)) loop. But "for" loops
> > are slow especially if list3 is HUGE.
> >
> > What can I do?
>
> Use mapply(). I wouldn't expect the for loop to be all that slow
> unless you have forgotten to allocate memory for the result list up
> front, though.
>
If you preallocate the memory the for loop is probably faster than
mapply().
-thomas
______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html