Learn R Programming

stream (version 0.1-1)

reset_stream: Reset a Data Stream to its Beginning

Description

Resets the counter in a DSD object to the beginning.

Usage

reset_stream(dsd)

Arguments

dsd
Either a DSD_ReadStream or DSD_Wrapper object.

Details

Resets the counter of the stream object. For DSD_ReadStream objects, this is done by calling seek() on the underlying connection. For DSD_Wrapper, the counter stored in the environment variable is moved back to 1.

See Also

DSD_ReadStream, DSD_Wrapper

Examples

Run this code
# initializing the objects
dsd <- DSD_GaussianStatic(k=3, d=2)
replayer <- DSD_Wrapper(get_points(dsd, 100), k=3)
replayer

p <- get_points(replayer, 50)
replayer

reset_stream(replayer) # resetting the dsd to its original state
replayer

Run the code above in your browser using DataLab