0

For example, 15 GB 3D cube of 32f type is stored in a file in binary format. I know ff package let user map an object to a memory-mapped file. So I wonder if, with ff, I can map an object to the 3D cube file that was not created by ff.

Apparent benefit would be efficient memory management while using the 3D cube. I tried to find some references on this but I couldn't find any related material even from ff package documentation. Any hint will be appreciated.

4

1 回答 1

3

You can, though I have not tried this before.

Simple test:

library(ff)
writeBin(as.vector(volcano), "file.bin", size = 8)
a <- ff(filename = "file.bin", readonly = TRUE, vmode = "double", dim = dim(volcano))
image(as.ram(a))

I would test carefully before you work with that file of yours, but that works with readonly = FALSE and I can modify values, delete a, recreate it and the modifications are there.

于 2013-07-24T20:21:10.167 回答