[R] Fatal error: unable to restore saved data in .RData

Luke Tierney luke at stat.uiowa.edu
Fri Oct 10 17:24:00 CEST 2008


On Fri, 10 Oct 2008, Thompson, David (MNR) wrote:

> Hello,
>
> I may have found the problem, although I don't understand it.
> When I commented out the following line in my Rprofile.site file the
> problem _seemed_ to disappear.
> 	# ans as shorthand for .Last.value
> 	# makeActiveBinding("ans", function() .Last.value, .GlobalEnv)

What I believe is happening is that your profile sets this up as an
active binding that cannot be assigned to before the .RDate is loaded
and loading the .RData is trying to assign to it.  If you want to
avoid the error you can use

     ## the argument 'v' means assignment to 'ans' will be ignored instead of
     ## generating an error message.
     makeActiveBinding("ans", function(v) .Last.value, .GlobalEnv)

> I decided to do this after reading the help for bindenv {base} and the
> phrase ". . . experimental interface . . ." JUMPED right out at me.
> Again, I don't know if this was _actually_ the cause of my problem but,
> I am underway again.

It would probably be best to recommend that the functins used in
active bindings always take one argument and, if assignment is not
supposed to happen, either ignore that argument it it is supplied or
signal an explicit error.  I'll look at the help page and think about
appropriate changes.

Best,

luke

>
> Thanx, DaveT.
>> -----Original Message-----
>> From: Thompson, David (MNR)
>> Sent: October 10, 2008 10:26 AM
>> To: 'r-help at r-project.org'
>> Subject: Fatal error: unable to restore saved data in .RData
>>
>> Hello,
>>
>> I am unable to start an R session by double-clicking on an
>> existing .RData file from the Windoze file explorer.
>> A dialogue appears with the message
>> 	"Fatal error: unable to restore saved data in .RData",
>>
>> and I notice in the R Console the last few lines are:
>> 	"Loading required package: R2HTML
>> 	 NULL
>> 	 error in function ()  : unused argument(s) (1:43)"
>>
>> I tried starting a fresh R session, changing the working
>> directory, saving a new empty workspace, closing R, and
>> restarting with the new (empty) .RData file to the same effect.
>>
>> I tried with the --vanilla option, changing the working
>> directory and loading the existing workspace,  and get the
>> error message:
>> 	"Error in function ()  : unused argument(s) (1:43)"
>>
>> And again with the --no-restore-data option, same effect.
>>
>> Suggestions?
>> Thanx, DaveT.
>> ###
>> # system info:
>>> sessionInfo() ; cat("\n") ; Sys.info()[c(1:3,5)]
>> R version 2.7.2 (2008-08-25)
>> i386-pc-mingw32
>>
>> locale:
>> LC_COLLATE=English_Canada.1252;LC_CTYPE=English_Canada.1252;LC_
>> MONETARY=English_Canada.1252;LC_NUMERIC=C;LC_TIME=English_Canada.1252
>>
>> attached base packages:
>> [1] stats     graphics  grDevices datasets  tcltk     utils
>> methods   base
>>
>> other attached packages:
>> [1] debug_1.1.0     mvbutils_1.1.1  lattice_0.17-14
>> plotrix_2.4-7   svSocket_0.9-5  TinnR_1.0.2     R2HTML_1.59
>> Hmisc_3.4-3
>>
>> loaded via a namespace (and not attached):
>> [1] cluster_1.11.11 grid_2.7.2      svMisc_0.9-5    tools_2.7.2
>>
>>  sysname                      release
>> version                      machine
>> "Windows"                         "XP" "build 2600, Service
>> Pack 2"                        "x86"
>> # system info:
>> ###
>> *************************************
>> Silviculture Data Analyst
>> Ontario Forest Research Institute
>> Ontario Ministry of Natural Resources
>> david.john.thompson at ontario.ca
>> http://ontario.ca/ofri
>> *************************************
>>
>
> ______________________________________________
> 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.
>

-- 
Luke Tierney
Chair, Statistics and Actuarial Science
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa                  Phone:             319-335-3386
Department of Statistics and        Fax:               319-335-3017
    Actuarial Science
241 Schaeffer Hall                  email:      luke at stat.uiowa.edu
Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu



More information about the R-help mailing list