[R] Is there a test for .Alias?

Thomas Lumley tlumley at u.washington.edu
Thu Aug 2 17:29:21 CEST 2001


On Wed, 1 Aug 2001, Henrik Bengtsson wrote:

> Is there a way to check if a variable is aliases to another? Example:
>
>   x <- list(a=1, b=2, c=3)
>   y <- .Alias(x)
>
> Can one tell that 'y' is an alias to another object? By the way, is it a
> correct statement to say that 'y' is aliased TO 'x', or is both 'x' and 'y'
> said to be aliased to an internal object?

The correct statement is that, since .Alias shouldn't be used, 'y' is not
aliased to 'x'.

You can't tell except in internal C code by checking that the objects are
pointers to the same place.


	-thomas

Thomas Lumley			Asst. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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