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

Weiwei Shi helprhelp at gmail.com
Wed Oct 25 17:59:09 CEST 2006


Hi,
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.

thanks

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

"Did you always know?"
"No, I did not. But I believed..."
---Matrix III



More information about the R-help mailing list