stream (version 1.3-0)

write_stream: Write a Data Stream to a File

Description

Writes points from a data stream DSD object to a file or a connection.

Usage

write_stream(dsd, file, n=100, block=100000L, 
	class=FALSE, append = FALSE, sep=",", header=FALSE, row.names=FALSE, ...)

Arguments

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.

block

Write stream in blocks to improve file I/O speed.

class

Save the class/cluster labels of the points as the last column.

sep

The character that will separate attributes in a data point.

append

Append the data to an existing file.

header

A flag that determines if column names will be output (equivalent to col.names in write.table()).

row.names

A flag that determines if row names will be output.

...

Additional parameters that are passed to write.table().

Value

There is no value returned from this operation.

See Also

write.table, DSD

Examples

Run this code
# 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 DataCamp Workspace