[Rd] comment propagation

Gabor Grothendieck ggrothendieck at myway.com
Sun Oct 3 22:52:39 CEST 2004


Consider the following where we add a comment, "One", to the
variable x.  Then we create a transformation of x putting it
in variable y and display y's comment.  y's comment turns out
to be the same as that of x.

> x <- 1
> comment(x) <- "One"
> 
> y <- x + 1
> comment(y)
[1] "One"

It seems that Ops propagates the comment attribute.  The problem
is that if I have multiple variables and am tryng to remember
which is which this will result in numerous copies of the comment
preventing me from figuring out which is the real One.  Every
transformation of my original data will have the same comment.

I don't think this behavior is really desirable but does anyone
have any perspective on this?



More information about the R-devel mailing list