Learn R Programming

stream (version 2.0-1)

DST_WriteStream: Task to Write a Stream to a File or a Connection

Description

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

Usage

DST_WriteStream(file, append = FALSE, ...)

# S3 method for DST_WriteStream close_stream(dsd, ...)

Arguments

file

A file name or a R connection to be written to.

append

Append the data to an existing file.

...

further arguments are passed on to write_stream(). Note that close is always FALSE and cannot be specified.

dsd

a DSD_WriteStream object with an open connection.

Author

Michael Hahsler

Details

Note: header = TRUE is not supported for files. The header would be added for every call for update.

See Also

Other DST: DSAggregate(), DSClassifier(), DSC(), DSOutlier(), DSRegressor(), DST_SlidingWindow(), DST(), evaluate, predict(), stream_pipeline, update()

Examples

Run this code
set.seed(1500)

stream <- DSD_Gaussians(k = 3, d = 2)
writer <- DST_WriteStream(file = "data.txt", info = TRUE)

update(writer, stream, n = 2)
readLines("data.txt")
update(writer, stream, n = 3)
readLines("data.txt")

# clean up
close_stream(writer)

file.remove("data.txt")

Run the code above in your browser using DataLab