[ESS] R starts slowly in ESS

Martin Maechler maechler at stat.math.ethz.ch
Wed May 23 15:55:33 CEST 2007


>>>>> "Georg" == Georg Otto <georg.otto at tuebingen.mpg.de>
>>>>>     on Wed, 23 May 2007 11:39:41 +0200 writes:

    Georg> "Richard M. Heiberger" <rmh at temple.edu> writes:
    >> We need all the information that the R posting guide requests
    >> 
    >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html 
    >> and provide commented, minimal, self-contained, reproducible code. 
    >> 
    >> at least the computer name and operating system.


    Georg> Sorry, I forgot to add the operating system, I am working on a Mac and
    Georg> I do not observe the mentioned problems on a Linux installation of R
    Georg> 2.5 and ESS 5.3.4

    Georg> Meanwhile, I found out that the problem is dependent on the presence
    Georg> of a saved workspace in a .RData file. For example, if I start R with
    Georg> ESS in a new directory that does not contain a .RData file, it takes
    Georg> 2-3 seconds to show the prompt and this message appears:

    >> if(!exists("baseenv", mode="function")) baseenv <- function() NULL
    >> options(STERM='iESS', editor='gnuclient -q')


    Georg> After generating a .RData file by creating a vector a<-c(1:10) and
    Georg> exiting R with saving the workspace, re-starting R takes about 45
    Georg> seconds and a different prompt appears (without the aforementioned
    Georg> message):

    Georg> [Previously saved workspace restored]

    Georg> > 

    Georg> Starting R from the bash shell however does not show this difference.

    Georg> Here is the output of sessionInfo():

    Georg> R version 2.5.0 (2007-04-23) 
    Georg> powerpc-apple-darwin8.9.0 

    Georg> locale:
    Georg> C

    Georg> attached base packages:
    Georg> [1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  "methods"  
    Georg> [7] "base" 

Thank you, Georg, for the extra detail.

First an important "ESS-philosophical" remark:

   Using a saved  .RData  is really very ``ESS-unlike''
   I'd say that 
   ``Real ESS-aficionados'' believe that the "Source is Real"
   and never save workspaces -- I really never ever do.
   I occasionally do save(..) on specific (lists of) objects, which
   I load() back when needed, but I never use save.image() nor the
   equivalent of q('yes')

Now to what you really wanted to know;
I think what happens may be the followoing:

 Your .RData contains a lot of R objects (which I'd call "Junk" ;-).
 When starting R from the console, these objects are not ``really
 activated'' (but only "promises" are),
 whereas ESS does --- for the sake of later object name completion ---
 "look" at all objects available in search().

Regards,
Martin Maechler, ETH Zurich




More information about the ESS-help mailing list