Skip to content
Prev 586 / 63424 Next

R-alpha: Assingment to list or vector elements

When you assign a value to an object which exists in some database on
the search list, R creates a copy in the current environment. However,
if the object is a list or vector, and you assign a new value to one of
its elements, a copy is not made and the assignment fails (with no error
message!).  This behaviour is incompatible with S-PLUS, which will make
a copy of the object before modifying one of its elements.

Martyn
[1] FALSE
$one
[1] 1

$two
[1] 1
$one
[1] 1

$two
[1] 1
[1] FALSE
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-