This function requires the bigdata library section to be loaded.
bd.pack.object(x) bd.unpack.object(x)
bd.pack.object
this can be any object.
For
bd.unpack.object
this must be a
bdPackedObject
object.
bd.pack.object
returns a
bdPackedObject
object,
which contains a reference to an external cache holding the data.
bd.unpack.object
returns the unpacked data object.
These functions can be used to store an arbitrary data object into an external
cache, and then unpack it to retrieve the original data.
The advantage of doing this is that even if the data object is quite large,
the resulting
bdPackedObject
object is fairly small.
For example, one could create a list containing thousands of packed model objects,
even if a single list containing all of the unpacked objects would be too large
to fit in memory.
temp <- bd.pack.object(fuel.frame) all.equal(fuel.frame, bd.unpack.object(temp)) # The same object.size(fuel.frame) object.size(temp) # Bit smaller; though the real benefit is when working with # much larger objects.