Skip to content
Prev 279720 / 398506 Next

R function implementation

Before rewriting in C, especially if you are new at it, have you
profiled (Rprof) your function to see the time is being spent?  Are
you using dataframe or matrices; there is a big speed different
between them when accessing data.  So profile your code, see where the
time is spent and then decide what to do about it.  Depending on your
choice of data structures and algorithms, R can be very fast.  So take
some time, profile your code and provide a sample of the function so
that we can see what you are trying to do and then maybe we would
suggest other approaches.  I have been using R/SPlus for a number of
years, know C reasonably well, and have yet to write any function in C
to improve the speed of R.
On Wed, Dec 7, 2011 at 7:02 PM, Diviya Smith <diviya.smith at gmail.com> wrote: