[R] Cannot quit R - fame package issue?

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Nov 18 09:00:10 CET 2008

See the help for .Last:

      Immediately _before_ terminating, the function '.Last()' is
      executed if it exists and 'runLast' is true. If in interactive use
      there are errors in the '.Last' function, control will be returned
      to the command prompt, so do test the function thoroughly.

You can avoid it via arguments to q() (see its help). However, if the 
'fame' package has been ill-mannered enough to put a .Last in your 
workspace, then you can and should delete it and re-save the workspace.

I can't see the function "validServerIsRunning" in the current fame 
package, so it may be a legacy of a workspace from an earlier version.

Packages really should not be using the user's workspace, and in 
particular not setting .Last there.  A couple of packages do have .Last in 
their space, but it is not guaranteed that their version will be visible: 
reg.finalizer() is the way to do this in a package.

On Mon, 17 Nov 2008, Dan Slayback wrote:

> Hello list member:
> I've recently had a problem in that I'm unable to quit an R Session. I 
> noticed this after the update to 2.8.0, but I believe I also noticed it on 
> another machine, in the previous version.  It occurs on both linux and Mac 
> platforms. It only occurs when I start R in some particular workspaces that 
> have alot of objects in them; it does not occur if I start R in an empty 
> workspace. I dont have to do anything in the workspace after starting R to 
> get this to occur, and no packages are loaded by default. Here's a summary 
> from a Linux environment:
> ------------------------------------------
> $ R
> R version 2.8.0 (2008-10-20)
> Copyright (C) 2008 The R Foundation for Statistical Computing
> ISBN 3-900051-07-0
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
> Natural language support but running in an English locale
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
> [Previously saved workspace restored]
>> search()
> [1] ".GlobalEnv"        "package:stats"     "package:graphics"
> [4] "package:grDevices" "package:utils"     "package:datasets"
> [7] "package:methods"   "Autoloads"         "package:base"    > q()
> Save workspace image? [y/n/c]: n
> Error in .Last() : could not find function "validServerIsRunning"
>> .Last
> function ()
> {
>   if (exists("fameRunning") && fameRunning())
>       fameStop()
>   if (validServerIsRunning())
>       endServerSession()
> }
> <environment: namespace:fame>
> ------------------------------------------
> As the .Last function is referring to the fame package, I figure it must be 
> something to do with that. There are objects in the workspace that require 
> fame to be loaded, but at this point, I have not loaded the fame package, or 
> accessed those objects. If loaded, the same error occurs when trying to quit.
> Thanks in advance for any suggestions on how to troubleshoot this.
> Dan
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

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