RE: [R] .Alias

About this list Date view Thread view Subject view Author view Other groups

Subject: RE: [R] .Alias
From: Jens Oehlschlägel (jens.oehlschlaegel@bbdo-interone.de)
Date: Thu 26 Oct 2000 - 23:14:14 EST


Message-ID: <000201c03f4e$a4114c90$c10616ac@bbdo.de>

Not only changing mode or length (i.e. structure) of the original object
results in converting an .Alias into a real copy, as the following examples
show:

> x <- 1:9
> y <- .Alias(x[9])
> y[1]
[1] 9
> y[1] <- 10
> x
[1] 1 2 3 4 5 6 7 8 9
# not [1] 1 2 3 4 5 6 7 8 10 as expected

> x <- 1:9
> y <- .Alias(x[9])
> x[9] <- 10
> y
[1] 9
# not [1] 10 as expected

Why is that? Are these read-ony pointer?

Jens

> version
         _
platform Windows
arch x86
os Win32
system x86, Win32
status
major 1
minor 1.1
year 2000
month August
day 15
language R

Mit freundlichen Grüßen

--
Dr. Jens Oehlschlägel
Analyse
BBDO InterOne
Grünstr. 15
40212 Düsseldorf

Tel.: +49 (0)211 1379-187 Fax.: +49 (0)211 1379-461 http://www.bbdo-interone.de

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help 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-help-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b25 : Thu 01 Feb 2001 - 16:14:29 EST