R: did you know ``comment(.) and comment(.) <- ...''

Ross Ihaka ihaka@stat.auckland.ac.nz
Sat, 28 Mar 1998 09:31:21 +1200 (NZST)


> From r-devel-owner@stat.math.ethz.ch Sat Mar 28 02:30 NZS 1998
> Date: Fri, 27 Mar 1998 15:33:02 +0100
> From: Martin Maechler <maechler@stat.math.ethz.ch>
> To: R-devel@stat.math.ethz.ch
> Subject: R: did you know  ``comment(.) and  comment(.) <- ...''
> Mime-Version: 1.0 (generated by tm-edit 7.95)
>
> I'm doing some systematic investigations about which functions are
> <primitive> in R (and which of these should be changed to .Internal(...))...
>
> I just discovered :
>
> > x <- 1:10
> > comment(x)
> NULL
> > comment(x) <- "x is just a vector"
> > x
>  [1]  1  2  3  4  5  6  7  8  9 10
> > attributes(x)
> $comment
> [1] "x is just a vector"
>
> > comment(x)
> [1] "x is just a vector"
>
> ----------
> Who of you (besides Ross?)  did know this feature.

You are making the assumption that I know about this :-).
I do have a very vague memory of trying something like this as
and experiment.  Is it worth keeping?

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