[R] editing in R

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Wed Nov 3 17:19:47 CET 1999


Peter Dalgaard BSA <p.dalgaard at biostat.ku.dk> writes:

> This because C-c C-d is using dump() which ignores the stored source.
> This should probably be changed.

OK. Fixed for next version. Here's the patch if you want to try:

Index: src/main/deparse.c
===================================================================
RCS file: /home/rdevel/CVS-ARCHIVE/R/src/main/deparse.c,v
retrieving revision 1.30
diff -u -r1.30 deparse.c
--- deparse.c   1999/10/15 15:12:22     1.30
+++ deparse.c   1999/11/03 16:15:05
@@ -272,6 +272,8 @@
     if(strlen(CHAR(STRING(file)[0])) == 0) {
        for (i = 0; i < nobjs; i++) {
            Rprintf("\"%s\" <-\n", CHAR(STRING(names)[i]));
+           if (TYPEOF(CAR(o)) != CLOSXP || 
+               isNull(tval = getAttrib(CAR(o), R_SourceSymbol)))
            tval = deparse1(CAR(o), 0);
            for (j = 0; j<LENGTH(tval); j++) {
                Rprintf("%s\n", CHAR(STRING(tval)[j]));
@@ -284,6 +286,8 @@
            errorcall(call, "unable to open file");
        for (i = 0; i < nobjs; i++) {
            fprintf(fp, "\"%s\" <-\n", CHAR(STRING(names)[i]));
+           if (TYPEOF(CAR(o)) != CLOSXP || 
+               isNull(tval = getAttrib(CAR(o), R_SourceSymbol)))
            tval = deparse1(CAR(o), 0);
            for (j = 0; j<LENGTH(tval); j++) {
                fprintf(fp, "%s\n", CHAR(STRING(tval)[j]));


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