Re: [R] Permanent assignments

From: Prof Brian Ripley <>
Date: Sat 04 Feb 2006 - 20:58:32 EST

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,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Sat Feb 04 21:07:37 2006

This archive was generated by hypermail 2.1.8 : Sun 05 Feb 2006 - 03:28:38 EST