[R] Permanent assignments

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat Feb 4 10:58:32 CET 2006


On Sat, 4 Feb 2006, Mikael Anderson wrote:

> I was wondering if it is possible to have permanent assignments in R pretty
> much in the same sense that S-Plus works.

It is not possible (a consequence of the scoping differences is that R 
objects are not self-contained).  If you want S-PLUS, you know where to 
get it.

> The reason I am asking this is that I was trying to load a FORTRAN 
> subroutine to R and for some reason it didn't work and R crashed and I 
> lost everything which I hadn't saved with save.image() or other similar 
> functions. I tried adding on.exit(save.image()) to .Last() but it seems 
> that if R crashes it doesn't get executed either.

Take a look at the R-devel version of R.  That has a signal handler that
allows you to save your work when it catches a segfault etc.  Or you could 
ensure that you call save.image() before doing anything error-prone.

> I am not saying that this should be the default behaviour in R but I was
> wondering if one could  have this as an option in R as well.
>
> /Mikael
>
> PS. In case it matters, I run R 2.2.1 under sparc-sun-solaris2.9.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list