write_stream | R Documentation |
Writes points from a data stream DSD object to a file or a connection.
write_stream( dsd, file, n, block = 100000L, info = FALSE, append = FALSE, sep = ",", header = FALSE, row.names = FALSE, close = TRUE, ... )
dsd |
The DSD object that will generate the data points for output. |
file |
A file name or a R connection to be written to. |
n |
The number of data points to be written. For finite streams, |
block |
Write stream in blocks to improve file I/O speed. |
info |
Save the class/cluster labels and other information columns with the data. |
append |
Append the data to an existing file. If |
sep |
The character that will separate attributes in a data point. |
header |
A flag that determines if column names will be output
(equivalent to |
row.names |
A flag that determines if row names will be output. |
close |
close stream after writing. |
... |
Additional parameters that are passed to |
There is no value returned from this operation.
Michael Hahsler
write.table
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.