Skip to content
Prev 131816 / 398503 Next

R computing speed

Dear Jim,

Thanks a lot for your suggestion. Indeed substituting the function apply
with rowSums made a great difference. Now the code is much faster!

Cheers,

Carlo

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of jim holtman
Sent: 11 December 2007 15:09
To: Carlo Fezzi
Cc: r-help at r-project.org
Subject: Re: [R] R computing speed

I would suggest that you use Rprof to get a profile of the code to see
where time is being spent.  You did not provide commented, minimal,
self-contained, reproducible code, so it is hard to tell from just
looking at the code to determine what is happening.  Rprof should
provide an idea of where to look in your code for optimization.  You
might consider colMeans instead of the "apply", but I am not sure if
this will make a significant change in the execution time.
On Dec 11, 2007 6:55 AM, Carlo Fezzi <C.fezzi at uea.ac.uk> wrote:
it
Press.
result$hessian[-(((c.base-1)*nx)+1):-(c.base*nx),-(((c.base-1)*nx)+1):-(c.ba
http://www.R-project.org/posting-guide.html