[R] SUMMARY and follow up question: organizing work; dump function

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Fri Sep 29 13:42:35 CEST 2000


Prof Brian D Ripley <ripley at stats.ox.ac.uk> writes:

> > Is this behaviour intended? I mean, some potentially useful information may
> > get lost this way (as an "ordinary" user, I would look at a function
> > definition by page() or print(), unlikely by looking in a packages function
> > file).
> 
> It is intended. Look at options(keep.source) and the keep.source argument
> to library.

Intended, but unfortunate. The matter is that the structure of the R
parser does not make it easy to store comments in the parsed objects.
In fact, the parse and deparse operations are not exact inverses of
eachother (try quote("+"(2,2)) for instance) so insertion points for
comments tend to get confused. We used to have lots of weirdness with
comments moving from the top to the bottom of loops, for instance.

So the current convention is to store the actual source with the
parsed object, or discard it completely including any comments. Since
some of the larger packages like nlme contain a rather hefty amount of
code, the default is to discard it. 

It would seem that one could do better and keep at least some of the
comments. So the situation may change if someone gets around to taking
a harder look at the parser.

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