Reset a Data Stream to its Beginning
Resets the counter in a DSD object to the beginning or any other position in the stream.
reset_stream(dsd, pos = 1)
- An object of class a subclass of
DSDwhich implements a reset function.
- Position in the stream (the beginning of the stream is position 1).
Resets the counter of the stream object.
For example, for
DSD_Memory, the counter stored in the
environment variable is moved back to 1.
DSD_ReadCSV objects, this is done by calling
seek() on the
# initializing the objects stream <- DSD_Gaussians(k=3, d=2) replayer <- DSD_Memory(stream, 100) replayer p <- get_points(replayer, 50) replayer # reset replayer to the begining of the stream reset_stream(replayer) replayer # set replayer to position 21 reset_stream(replayer, pos=21) replayer