[R] source of R functions {was ... aov ...}

From: Martin Maechler <maechler_at_stat.math.ethz.ch>
Date: Fri 24 Jun 2005 - 02:57:27 EST

>>>>> "RenE" == RenE J V Bertin <rjvbertin@gmail.com>
>>>>> on Thu, 23 Jun 2005 17:37:14 +0200 writes:

    RenE> Thanks to all the others who replied.  

      BDR> and do note it is unset again a few lines later.
      BDR> (Listing a function inside R is not giving you the
      BDR> `source code'.)

nor does RenE's fix(aov) {mentioned later in his post}.

We have been on this topic many times: The source code is in *files*, publicly available from CRAN (and even with your web browser from https://svn.R-project.org/R/ where e.g. tags/R-2-1-1/ contains the source of R 2.1.1).
And this applies to CRAN (or Bioconductor) packages as well as the "base R" code: The real source is in files.

Looking at the object {via "typing its name" or e.g. fix() or an "object browser"} basically (not quite!) provides the result of source() {+ save() and load() in some cases} of the original source files; and this should be about the same as what you'd get from print( parse(...) ) of the source text.

What's the difference? At least these:

1a) All the comments inside functions are lost. 1b) all other comments between object {typically function} definitions,

    and the grouping {into files; sections inside files, ...}     and logical sequence of the definitions is lost. 2) The author's formatting is lost.

3) only " ... " are used for strings (even when the original had '...') 4) numerical constants are shown in a uniform way, not as

   entered { .1 |-> 0.1 1e1 |-> 10 etc }

where "1)" and "2)" can be important and I consider a drawback; 3 and 4 are less important and typically an advantage, and '2)' is an advantage for some people's R code because it makes it prettier. (! ;-)

Martin Maechler, ETH Zurich

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Jun 24 03:04:13 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:00 EST