Hello David, On Apr 30, 2010, at 11:00 PM, David Winsemius wrote: > Note: Loops may be just as fast or faster than apply calls. > How come!? is this true also for other similar functions: lapply, tapply and sapply?
Then the only advantage of these above is only syntactic sugar? >> >> indices <- replicate(B,sample(1:N, size=N, replace=TRUE)) >> theta_star <- apply(indices,2,statistic,data) > > Why not: > > theta_star <- apply(indices,2, function(x) statistic(data, x) ) > > May end up as a data class that needs further work, depending on what > "statistic" return. > Nice! thank you! Best regards, Giovanni ______________________________________________ R-help@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.