[R] Re: ESS for R

B.Rowlingson@lancaster.ac.uk B.Rowlingson at lancaster.ac.uk
Tue Dec 19 17:43:47 CET 2000

> HOWEVER, you mentioned that what you wanted was the "default" function
> thing, i.e.
>         dumped <- function { }
> placed into a non-existant buffer.  This is a difference as far as how
> S-PLUS and R dump objects, I think.  Your point, which I recall (I've
> not used S-PLUS for actual data analysis in a long time) is that this
> gets set for non-existant objects when using ESS for S-PLUS, and not
> for R, sounds familiar.
> I've CC'd ESS-help and R-help; can anyone verify this discrepancy
> (with ESS under S-PLUS and R)?

 Its because the first thing Splus's dump(foo) function does is to write

"foo" <- 

 into the dump file. If the object doesn't exist, its not until that
that the dump stops, and you are left with  '"foo" <-' in the file. 

 ESS uses this, and appends the ess-function-template to get 

"foo" <- function( ) { } 

 in function ess-dump-file-other-window.

 Since R gives you a zero-length file when you dump a non-existent
ESS cant use this trick, and since ess-dump-file-other-window is only
passed the filename and not the object name it cant write it to the file
(unless it deparses the filename. Ick.).

 I've rewritten ess-dump-file-other-window to take filename and object
argument. If it spots a new object (using the ess-dumped-missing-re as
then it clears out the buffer and inserts "object" <-

 This works for Splus 5 and R 1.2.0. I don't have any of the other
systems that
ESS uses so I cant see if it breaks anything else.

 One other related matter - if ess-function-template isn't formatted
exactly how
the pretty-formatter does it, then the buffer is reformatted and marked
as modified,
nullifying the (set-buffer-modified-p nil) in the dump function. Bug or
You decide.

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