[R] How to speed up regressions (related to data.frame)

Jean-Christophe BOUËTTÉ jcbouette at gmail.com
Tue Sep 6 22:02:56 CEST 2011


I just tried
library(MASS)
rlm(1:12+rnorm(12),1:12)

it seems it works on vectors too, but maybe I miss something.

2011/9/6 Bos, Roger <roger.bos at rothschild.com>:
> All,
>
> I have a function that runs a set of regressions (using the rlm
> function) and I notice that it run much slower on my 64-bit R than it
> does on my 32-bit R.  I guess the bigger bit size slows it down.
> Anyway, I looked into Rprof to see how I can speed it up.  I saw that
> 78% of the total time is spent in [.data.frame, so I tried converting my
> data to a matrix using data.matrix, but then rlm complained that data
> needs to be in the form of a data.frame.  Am I stuck or is there still
> maybe a way to speed up my function?
>
> Thanks,
>
> Roger
> ***************************************************************
>
> This message is for the named person's use only. It may\...{{dropped:14}}
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list