[R] Trouble loading "saved" Rdata

David Winsemius dwinsemius at comcast.net
Sun Aug 15 15:44:49 CEST 2010


On Aug 15, 2010, at 3:06 AM, steven mosher wrote:

> Did you exit R and then return?
>
> fname<-"test.Rdata"
> full<-file.path("Example",fname,fsep=.Platform$file.sep)
> full
> [1] "Example/test.Rdata"
> load(full)
> test
> NULL

I am unable to reproduce the problem (after correcting two different  
syntactic errors in the initial posting that should have thrown errors  
and prevented the creation of both "test" and "full" . I didn't exit  
my session and return but I did remove the test" object after saving  
it. My guess is that the test object was not correctly formed at the  
time it was saved.

 > test<-data.frame(a=c(1,2,3),b=c(3,4,5))
 >  save(test,file=full)
 > test
   a b
1 1 3
2 2 4
3 3 5
 > full
[1] "Example/test.Rdata"
 >  rm(test)
 > load(file=full)
 > test
   a b
1 1 3
2 2 4
3 3 5

(I pretty much have the same setup that is indicated below running on  
MacOS 10.5.8.)

-- 
David.



>> sessionInfo()
> R version 2.11.1 (2010-05-31)
> x86_64-apple-darwin9.8.0
>
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> loaded via a namespace (and not attached):
> [1] tools_2.11.1
>
> On Sat, Aug 14, 2010 at 5:35 PM, Joshua Wiley  
> <jwiley.psych at gmail.com>wrote:
>
>> That worked for me once I properly quoted "test.RData" on
>>
>>> sessionInfo()
>> R version 2.11.1 (2010-05-31)
>> x86_64-pc-mingw32
>>
>> locale:
>> [1] LC_COLLATE=English_United States.1252
>> [2] LC_CTYPE=English_United States.1252
>> [3] LC_MONETARY=English_United States.1252
>> [4] LC_NUMERIC=C
>> [5] LC_TIME=English_United States.1252
>>
>> If correcting the quoting does not help you, perhaps you can report
>> the results of sessionInfo()
>>
>> Cheers,
>>
>> Josh
>>
>> On Sat, Aug 14, 2010 at 5:14 PM, steven mosher <moshersteven at gmail.com 
>> >
>> wrote:
>>> In the particular application I have I save "test.Rdata" to a sub
>> directory
>>> dir<-"Example"
>>> dir.create(dir)
>>> test<-data.frame(a=c(1,2,3),b=c(3,4,5)
>>>
>>> full<-file.path(dir,"test.Rdata,fsep=.Platform$file.sep)
>>> save(test,file=full)
>>> load(full)
>>> returns NULL
>>>
>>> it works fine when the object is saved to the working directory, but
>> fails
>>> when saved to a sub directory.
>>> The Rdata is there. Bytes are in it. but loading it doesnt work.
>>>
>>>       [[alternative HTML version deleted]]
>>>
>>> ______________________________________________
>>> 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.
>>>
>>
>>
>>
>> --
>> Joshua Wiley
>> Ph.D. Student, Health Psychology
>> University of California, Los Angeles
>> http://www.joshuawiley.com/
>>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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.

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list