[Rd] R 1.3.0 bug: after "y _ 10; x[[1]] _ y", assigning to "y[1]" modifies "x" (PR#1043)

buhr@stat.wisc.edu buhr@stat.wisc.edu
Tue, 7 Aug 2001 22:38:04 +0200 (MET DST)


After a list element has been assigned from a vector variable,
assigments to elements of the original vector variable modify the copy
stored in the list as well.

Here's a transcript illustrating the problem:

        R : Copyright 2001, The R Development Core Team
        Version 1.3.0  (2001-06-22)

        [ . . . ]

        > x _ list()
        > y _ 10
        > x[[1]] _ y
        > x
        [[1]]
        [1] 10

        > y[1] _ 20   # should only modify "y"
        > x
        [[1]]
        [1] 20        # ACK!  we modified "x", too

        > 

Kevin <buhr@stat.wisc.edu>

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._