[R] Cannot quit R - fame package issue?

Dan Slayback dan.slayback at nasa.gov
Tue Nov 18 14:02:09 CET 2008


Thanks very much for the tips. Simply removing .Last did allow me to 
exit, and looking at sessionInfo showed that there was a "fame_2.3" 
namespace loaded, even without loading the fame package, which I guess 
had this remnant code for .Last from a previous version of fame (there 
appears to be no .Last in the current version of fame):

 > sessionInfo()
R version 2.8.0 (2008-10-20)
x86_64-redhat-linux-gnu

locale:
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base    

loaded via a namespace (and not attached):
[1] fame_2.3


 > loadedNamespaces()
[1] "base"      "fame"      "graphics"  "grDevices" "methods"   "stats"   
[7] "utils"   


So after unloading the namespace fame, and rm(.Last), and re-saving the 
workspace, I can now exit without problems - thanks!


Prof Brian Ripley wrote:
> 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.
>>
>


-- 
___________________________________________________________________
Dan Slayback, PhD
Research Scientist
Science Systems and Applications, Inc.          tel: (301) 614-6687
Biospheric Sciences Branch, Code 614.4          fax: (301) 614-6695
NASA Goddard Space Flight Center              dan.slayback at nasa.gov
Greenbelt, MD 20771                   or daniel_slayback at ssaihq.com



More information about the R-help mailing list