[R-sig-finance] Price Smoothing
Dirk Eddelbuettel
edd at debian.org
Wed May 11 04:00:24 CEST 2005
On 10 May 2005 at 07:57, Steven D. Moffitt wrote:
| Since loops are slow in R,
Well, I think that is considered to be an outdated myth. There was a time
when S-Plus 3.* had dreadful looping performance, but both R and S-Plus now
have much improved parsers/interpreters. So no fear of for() or while().
On r-help we repeatedly see posts where people try real hard to use apply and
friends only to find that a simple for loop is doing just as well or better.
| If you really need speed, however, you should write a function in C/C++ and use in inside or outside R.
Correct.
And the tool to tell you is the fantastic profiler inside R. See help(Rprof).
Dirk
--
An economist is an expert who will know tomorrow why the things he
predicted yesterday didn't happen today. -- Laurence J. Peter
More information about the R-sig-finance
mailing list