[R] .Alias

Jens Oehlschlägel jens.oehlschlaegel at bbdo-interone.de
Thu Oct 26 15:14:14 CEST 2000


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 at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list