> "NM" == Norm Matloff
> 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-
Tal wrote:
> A friend recently brought to my attention that vector assignment actually
> recreates the entire vector on which the assignment is performed.
...
I brought this up in r-devel a few months ago. You can read my posting,
and the various replies, at
http://www.mail-archive.com/r-de...
On 01/09/2010 11:09 AM, Tal Galili wrote:
Hello all,
A friend recently brought to my attention that vector assignment actually
recreates the entire vector on which the assignment is performed.
So for example, the code:
x[10]<- NA # The original call (short version)
Is really doing this:
x<- re
Tal,
For your first example, x is not duplicated in memory. If you compile R
with --enable-memory-profiling, you have access to the tracemem()
function, which will report whether x is duplicate()d:
> x <- rep(1,100)
> tracemem(x)
[1] "<0x8f71c38>"
> x[10] <- NA
This does not result in duplicati
Thank you for the explanation Duncan - very interesting indeed!
I wonder if someone in the list might know to answer your question regarding
the double duplication.
Best,
Tal
Contact
Details:---
Contact me: tal.gal...@gmail.com
On Wed, Sep 1, 2010 at 8:09 AM, Tal Galili wrote:
> Hello all,
>
> A friend recently brought to my attention that vector assignment actually
> recreates the entire vector on which the assignment is performed.
>
> So for example, the code:
> x[10]<- NA # The original call (short version)
>
> Is rea
Hello all,
A friend recently brought to my attention that vector assignment actually
recreates the entire vector on which the assignment is performed.
So for example, the code:
x[10]<- NA # The original call (short version)
Is really doing this:
x<- replace(x, list=10, values=NA) # The original
7 matches
Mail list logo