[R] Why is vector assignment in R recreates the entire vector ?

Martin Maechler maechler at stat.math.ethz.ch
Fri Sep 3 09:38:18 CEST 2010


>>>>> "NM" == Norm Matloff <matloff at cs.ucdavis.edu>
>>>>>     on Thu, 2 Sep 2010 12:20:44 -0700 writes:

    NM> Tal wrote:

    >> A friend recently brought to my attention that vector assignment actually
    >> recreates the entire vector on which the assignment is performed.
    NM> ...

    NM> I brought this up in r-devel a few months ago.  

yes, thank you Norm, for the pointer.
Indeed this whole topic really belongs to R-devel not R-help.
Martin Maechler

    NM> You can read my posting,
    NM> and the various replies, at

    NM> http://www.mail-archive.com/r-devel@r-project.org/msg20089.html

    NM> Some of the replies not only explain the process, but list lines in the
    NM> source code where this takes place, enabling a closer look at how/when
    NM> duplication occurs. 

    NM> Norm Matloff



More information about the R-help mailing list