[R] performance question

Thomas W Blackwell tblackw at umich.edu
Fri Sep 26 17:52:17 CEST 2003


Axel  -

I believe that a function argument is not literally copied
until the first time it is modified within the function.
See email exchanges on this list from/to Ross Boylan within
the month of September for a more authoritative answer to
this question.  (Do you know about the R-help archives at
three sites listed on  http://cran.R-project.org/search.html ?)

-  tom blackwell  -  u michigan medical school  -  ann arbor  -

On Fri, 26 Sep 2003, Axel Benz wrote:

> I am about to write functions for multivariate kernel densitiy estimation
> with mixed categorical and continuous date (accoring to Jeff Racine and Qi
> Li), and the leave-one-out window esitmation needs a lot of computation.
> I am now optimizing the code performance and therefore fhe following
> questions:
>
> As R uses call-by-value for functions, is it computational expensive to pass
> large matrices in function arguments?
>
> (i.e. are they really copied and does this need much computing time?) Is it
> maybe better to work with locally visible variables and nested functions in
> the optimized code?
>
> I have already used Rprof (and I could speed up the code a lot by the
> information from Rprof), but it does not tell me about that.
>
> Thank you for your hints!
>
> Axel
> ________________________________________
> Fraunhofer Institut fuer
> Arbeitswirtschaft und Organisation (IAO)
> Dipl. Inf. Axel Benz
> Nobelstr. 12
> D-70569 Stuttgart
> Germany
> Tel. +49(0)7119702289
> Fax. +49(0)7119702192
> mail: mailto:axel.benz at iao.fhg.de
> www: http://www.vis.iao.fhg.de
> ________________________________________




More information about the R-help mailing list