
Writes points from a data stream DSD object to a file or a connection.
write_stream(dsd, file, n=100, block=100000L,
class=FALSE, append = FALSE, sep=",", header=FALSE, row.names=FALSE, ...)
The DSD object that will generate the data points for output.
A file name or a R connection to be written to.
The number of data points to be written.
Write stream in blocks to improve file I/O speed.
Save the class/cluster labels of the points as the last column.
The character that will separate attributes in a data point.
Append the data to an existing file.
A flag that determines if column names will be output
(equivalent to col.names
in write.table()
).
A flag that determines if row names will be output.
Additional parameters that are passed to write.table()
.
There is no value returned from this operation.
# NOT RUN {
# creating data and writing it to disk
stream <- DSD_Gaussians(k=3, d=5)
write_stream(stream, file="data.txt", n=10, class=TRUE)
#file.show("data.txt")
# clean up
file.remove("data.txt")
# }
Run the code above in your browser using DataLab