# create data and write 10 points to disk
stream <- DSD_Gaussians(k = 3, d = 5)
stream
write_stream(stream, file="data.txt", n = 10, header = TRUE, info = TRUE)
readLines("data.txt")
# clean up
file.remove("data.txt")
# create a finite stream and write all data to disk using n = -1
stream2 <- DSD_Memory(stream, n = 5)
stream2
write_stream(stream2, file="data.txt", n = -1, header = TRUE, info = TRUE)
readLines("data.txt")
# clean up
file.remove("data.txt")
Run the code above in your browser using DataLab