[R] Several simple but hard tasks to do with R

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Thu Aug 20 18:00:04 CEST 2009


On Thu, Aug 20, 2009 at 3:59 PM, Rakknar<aliengenesis at yahoo.com> wrote:

> I already using script. I'm using Tinn-R to write them. Thanks for the
> recommendation of the R2HTML package I'll see how to use it right now.

 If you run your script using the command line:

R CMD BATCH script.R script.Rout

 then you'll get a full transcript of input and outputs.

> Yes, I already know I can do things that way but it doesn't work for me: I
> want to be able to store several objects in one .Rdata file in a flexible
> and fast way. Writing one for each object seems too messy for me.

 Use one .RData file per object, and organise the mess by keeping
related .RData files in folders.

 What you seem to want is a storage mechanism that essentially
duplicates what file systems are meant for. Why should R developers
spend time on that when we all have file systems anyway? Storing
several things that may be changing in size in one file is not going
to be fast and flexible in any system. As objects change size you
either have to write the whole lot out again or do some clever
shuffling around, and then you get holes, and fragmentation, and then
you've essentially invented the filesystem.

 The other way of doing it is how Zope's Object Database works.
Whenever an object changes you append the new version to the file and
mark the previous one as old. Hence the object database grows and
grows until you do a 'purge' of old versions. If you wanted to write
an R object store that works like that, the R source code is
available...

 Or just use the filesystem.

Barry




More information about the R-help mailing list