From murdoch.duncan at gmail.com  Fri Aug 31 16:41:22 2012
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Fri, 31 Aug 2012 10:41:22 -0400
Subject: [Rd] Arrays Partial unserialization
In-Reply-To: <5040C084.1070305@gmail.com>
References: <5040C084.1070305@gmail.com>
Message-ID: <5040CD12.60205@gmail.com>

On 31/08/2012 9:47 AM, Damien Georges wrote:
> Hi all,
>
> I'm working with some huge array in R and I need to load several ones to
> apply some functions that requires to have all my arrays values for each
> cell...
>
> To make it possible, I would like to load only a part (for example 100
> cells) of all my arrays, apply my function, delete all cells loaded,
> loaded following cells and so on.
>
> Is it possible to unserialize (or load) only a defined part of an R array ?
> Do you know some tools that might help me?

I don't know of any tools to do that, but there are tools to maintain 
large objects in files, and load only parts of them at a time, e.g. the 
ff package.  Or you could simply use readBin and writeBin to do the same 
yourself.
>
> Finally, I did lot of research to find the way array (and all other R
> object) are serialized into binary object, but I found nothing
> explaining really algorithms involved. If someone has some information
> on this topic, I'm interesting in.

You can read the source for this; it is in src/main/serialize.c.

Duncan Murdoch
>
> Hoping my request is understandable,
>
> All the best,
>
> Damien.G
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] Arrays Partial unserialization
Duncan Murdoch