[Rd] attributes of environments

Gabor Grothendieck ggrothendieck at gmail.com
Wed Jul 5 18:10:02 CEST 2006


On 7/5/06, Thomas Lumley <tlumley at u.washington.edu> wrote:
> On Tue, 4 Jul 2006, Gabor Grothendieck wrote:
>
> > In the code below, e is an environment which we copy to f and then
> > add attributes to e.  Now f winds up with the same attributes.
> >
> > In other words it seems that the attributes are a property of the
> > environment itself and not of the variable.  Thus it appears we
> > cannot have two environment variables that correspond to the
> > original environment but with different attributes.
>
> No, we can't. The two variables are references to the same environment, so
> they are the same.
>
> If you want the attributes to be copies rather than references then create
> a list with the environment as an element and put the attributes on the
> list.

I realize that that is how it works but what I was really wondering was
should it work that way?



More information about the R-devel mailing list