[R] efficiency & profiling?
Duncan Murdoch
murdoch at stats.uwo.ca
Thu May 1 01:33:26 CEST 2008
On 30/04/2008 6:59 PM, esmail bonakdarian wrote:
> This has been an interesting discussion, and brings up two questions
> for me:
>
> Is there a good collection of hints/suggestions for R language idoms in terms
> of efficiency? For instance I read not to use for-loops, so I used apply only to
> later read that "apply" is internally implemented as a "for" so nothing gained
> here. Warnings about pitfalls (such as nested loops), hints, suggestions would
> be great.
>
> The second question - is there some sort of profiling tool available that would
> make it easy to recognize where the script is spending most of its time? Might
> be especially useful for newbies like me.
See ?Rprof for the tool. For the tips, I think you just need to hang
around here a while. I don't know of a nice collection (but I'm sure
there are several.)
Duncan Murdoch
More information about the R-help
mailing list