Coerce To or From a Big Data Object

DESCRIPTION:

Coerce a bdVector, bdFrame, or other big data object to the corresponding ordinary object, or the reverse. This is a generic function; methods currently exist for data.frame, bdFrame, bdVector, bdTimeSpan; the default method coerces ordinary matrices and vectors to bdFrame and bdVector, respectively.

This function requires the bigdata library section to be loaded.

USAGE:

bd.coerce(x, bigdata=F, ...) 

REQUIRED ARGUMENTS:

x
a bdVector, bdFrame, or other big data object, or the corresponding ordinary objects.

OPTIONAL ARGUMENTS:

bigdata
a logical flag, if FALSE (the default) then objects are coerced to their small data form, e.g. from bdFrame to a data frame. If TRUE, then objects are coerced to their big data form, e.g. from data frame to bdFrame.
...
additional arguments are passed to methods.

VALUE:

x is returned unchanged, if it is already of the desired type. Otherwise it it coerced to the type determined by the bigdata argument.

DETAILS:

This function is typically used to coerce a relatively small bdFrame or bdVector objects into the corresponding ordinary object. An error occurs if the object is too large for the available memory.

SEE ALSO:

, ,

EXAMPLES:

fuel.bd <- bdFrame(fuel.frame) 
bd.coerce(fuel.bd)      # returns a data frame 
bd.coerce(fuel.bd[[1]]) # returns a vector