[R] Applying user function over a large matrix

Sudipta Sarkar ssarkar at lanworth.com
Tue Apr 29 21:16:19 CEST 2008


Respected R experts,
I am trying to apply a user function that basically calls and
applies the R loess function from stat package over each time
series. I have a large matrix of size 21 X 9000000 and I need
to apply the loess for each column and hence I have
implemented this separate user function that applies loess
over each column and I am calling this function foo as follows:
xc<-apply(t,2,foo) where t is my 21 X 9000000 matrix and
loess. This is turning out to be a very slow process and I
need to repeat this step for 25-30 such large matrix chunks.
Is there any trick I can use to make this work faster?
Any help will be deeply appreciated.
Regards


Sudipta Sarkar PhD
Senior Analyst/Scientist
Lanworth Inc. (Formerly Forest One Inc.)
300 Park Blvd., Ste 425
Itasca, IL
Ph: 630-250-0468



More information about the R-help mailing list