[R] Storing/Restoring R objects

David Winsemius dwinsemius at comcast.net
Wed Jan 11 22:56:24 CET 2012


On Jan 11, 2012, at 2:56 PM, Rich Shepard wrote:

> One of my projects has generated quite a few objects (data frames)  
> related
> to one portion of this project. They can be listed with the ls()  
> function. What I would like to do is move them to another directory  
> so that data
> frames for other portions of the project can be more easily seen and  
> used.
>
> .RData is a binary file. Are there tools that let me work with this  
> file?

The R executable would be one such tool. The code is there if you want  
to go through it, but the unserialization process is notoriously  
complex. There is no counterpart to SAS Proc CONTENTS

> What if I rename it and start a new .RData file when I next invoke R?

Then R will not find it. (Actually there will be no .RData file until  
R executes save.image() at the end of the session. R does not create a  
fresh .RData at the beginning of a session.)

> Could
> I then specify which .RData file should be available on demand?

?Startup

You can have different ,RData files in different directories.
>

?save
?load


> I have not seen (or remembered if I did) discussions on this topic.  
> Please
> advise.


Please read more help pages. They generally have many useful links.

-- 
David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list