[R] How to add an object to an RData file ?

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jul 28 21:59:52 CEST 2004


I don't think it is that simple.  There are several save formats, some 
historical that no one wants to touch.  So suppose we confined it to the 
current format.  Then one would need a pass over the saved file to see 
what (e.g. namespaces) should be shared and to find the existing 
references, so I don't think it would actually save anything much.
(If you want to work out if shared can be skipped, the code is in 
serialize.c ....)

On Wed, 28 Jul 2004, Liaw, Andy wrote:

> I guess it would be nice if save() has an `append' option...
> 
> Andy
> 
> > From: Roger D. Peng
> > 
> > I can't think of a faster way.
> > 
> > -roger
> > 
> > Ernesto Jardim wrote:
> > > Hi,
> > > 
> > > I've saved an RData file with "save" and now I want to add 
> > a new object
> > > to this file. At the moment I do:
> > > 
> > > attach("file.RData")
> > > save(list=c("new,obj", ls(pos=2)), file="file.RData", compress=T)
> > > detach()
> > > 
> > > Is there a quicker method that just add the object to the file ?
> > > 
> > > Thanks
> > > 
> > > EJ
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 
> 

-- 
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