Divide Data into Blocks Defined by a Moving Window

DESCRIPTION:

Divide a dataset into multiple data blocks defined by a moving window over the dataset, and return a list of these data blocks.

This function requires the bigdata library section to be loaded.

USAGE:

bd.split.by.window(data, window, offset=0, drop.incomplete=F,
                    bigdata=is(x,"bdFrame"))

REQUIRED ARGUMENTS:

data
input data set: a bdFrame or data.frame.
window
number of rows in each block to be processed.

OPTIONAL ARGUMENTS:

offset
an integer that specifies if successive blocks are overlapping. If this is an integer greater than zero, this is the number of rows between the beginning of one block, and the beginning of the next. If this is less than or equal to zero, it is the same as specifying offset=window, so each block directly follows the previous one. If offset is greater than window, some rows will be skipped between blocks.
drop.incomplete
if TRUE, this will only process blocks with window rows. If this is FALSE, blocks at the end of the data set will be processed, even if they have less than window rows.
bigdata
if TRUE, returns a list of bdFrame objects. If FALSE, this returns a list of data.frame objects. The default uses the type of x to determine which type of objects to return.

VALUE:

A list with one element for every data block in the data, as defined by a moving window over the data rows. If the argument bigdata is TRUE, the list elements will be bdFrame objects; otherwise, they will be data.frame objects.

DETAILS:

This function divides the input data into blocks defined by a moving window over the data rows, and returns a list of all of these blocks.

If bigdata is FALSE, the output list elements will be data.frame objects. In this case, if all of the data is too large to fit in memory, an error will occur.

SEE ALSO:

, , .

EXAMPLES:

## Divide fuel.frame into a list of 5-row data.frames
bd.split.by.window(fuel.frame, 5)