Re: [R] Any way to add to data frame saved as .rData file?

From: Duncan Murdoch <>
Date: Wed 12 Oct 2005 - 06:38:31 EST

Ken Termiso wrote:
> Hi all,
> I've got a script that generates a few moderate-size data frames, and then
> puts them together into one big data frame at the end in order to write that
> data frame to disk, so that it may be re-opened later on...
> I'm trying to trim down memory requirements in this script, so I was
> wondering if there was any way to append to a data frame already saved on
> disk (just like appending to a text file)..all the data frames here have
> identical row names; what I want to do is to tack on additional columns to a
> data frame stored in the working directory...

No, I don't think so.
> Alternatively, is there another data structure that would allow me to do
> this (and could preferably be converted to a data frame) ?

I'd put the extra columns in their own data frame, and save that to disk (use dates/times/process ids or some other unique identifier in the filenames to distinguish them). When you need access to a mixture of columns, load (or source, depending how you did the save) the columns you need, and cbind them together into one big data frame.

If you are concerned about memory requirements when producing the pieces, watch out that you don't write out so much data that you'll never have enough memory to load all you need at once.

Duncan Murdoch mailing list PLEASE do read the posting guide! Received on Wed Oct 12 06:40:59 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:41 EST