Permanent assignments

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Permanent assignments

Mikael Anderson
I was wondering if it is possible to have permanent assignments in R pretty
much in the same sense that S-Plus works.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.

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.

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Permanent assignments

Brian Ripley
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,                  [hidden email]
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Permanent assignments

Gabor Grothendieck
In reply to this post by Mikael Anderson
You may be able to get checkpoint software that will periodically
save the state of the computer, including memory, allowing you
to roll back to any point.   That would not be R specific.  I don't
know specifically where to get it but maybe someone else knows
of or uses such software.

On 2/4/06, Mikael Anderson <[hidden email]> wrote:

> I was wondering if it is possible to have permanent assignments in R pretty
> much in the same sense that S-Plus works.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.
>
> 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.
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html