[R] how to improve the efficiency of the following lapply codes

From: Weiwei Shi <helprhelp_at_gmail.com>
Date: Wed 25 Oct 2006 - 15:59:09 GMT

I have a series of lda analysis using the following lapply function:

n <- dim(intersect.matrix)[1]
net1.lda <- lapply(1:(n), function(k) i.lda(data.list, intersect.matrix, i=k, w))

i.lda is function to do the real lda analysis.

intersect.matrix is a nx1026 matrix, n can be a really huge number like 60k. The target is perform a random search. Building a n=120k matrix is impossible for my machine. When n=5k, the task can be done in 30 min while n=60k, it is estimated to take 5 days. So I am wondering where my coding problem is, which causes this to be a nonlinearity.

If more info is needed, I will provide.


Weiwei Shi, Ph.D
Research Scientist
GeneGO, Inc.

"Did you always know?"
"No, I did not. But I believed..."
---Matrix III ______________________________________________ R-help@stat.math.ethz.ch 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.
Received on Thu Oct 26 07:35:53 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 25 Oct 2006 - 22:30:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.