DIterator {D2MCS} | R Documentation |
Iterator over a Subset object
Description
Creates a DIterator
object to iterate over the
Subset
.
Methods
Public methods
Method new()
Method for initializing the object arguments during runtime.
Usage
DIterator$new(data, chunk.size, verbose)
Arguments
data
A data.frame structure to be iterated.
chunk.size
An integer value indicating the size of chunks taken over each iteration. By default
chunk.size
is defined as 10000.verbose
A logical value to specify if more verbosity is needed.
Method getNext()
Gets the next chunk of data. Each iteration returns the same
instances (data.frame rows) as chunk.size. However, if remaining data if
less than chunk size, all the remaining data is returned. Conversely,
NULL when there is no more pending data. By default
chunk.size
is defined as 10000.
Usage
DIterator$getNext()
Returns
A data.frame of NULL if all the data have been previously returned.
Method isLast()
Checks if the DIterator
object reached the end
of the data.frame
Usage
DIterator$isLast()
Returns
A logical value indicating if the end of data.frame has been reached.
Method finalize()
Destroys the DIterator
object.
Usage
DIterator$finalize()
Method clone()
The objects of this class are cloneable with this method.
Usage
DIterator$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.