
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 DSD
which 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, forDSD_Memory
, the counter stored in the
environment variable is moved back to 1.
For DSD_ReadCSV
objects, this is done by calling seek()
on the
underlying connection.
# NOT RUN {
# 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
# }
Run the code above in your browser using DataLab