[R] self documenting workspaces, and the proper role of the dot

Peter Dalgaard BSA p.dalgaard at pubhealth.ku.dk
Mon Feb 19 18:23:21 CET 2001

Thomas Lumley <tlumley at u.washington.edu> writes:

> YOu could attach a "doc" attribute to everything. This has the
> disadvantage that for objects with no special "print" method the attribute
> would always be printed with the object.
> attr(a,"doc")<-"A is for apple"
> and you could write a function that listed objects and documentation using
> something like
> sapply(ls(),function(x) attr(x,"doc")

Actually, once upon a time in the far East, Ross wrote comment(x) and
comment(x)<- to do just that. We're not very good at keeping them,
though - for instance, they don't survive a fix() of the object.

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
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