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

View source: R/DST_WriteStream.R

DST_WriteStreamR Documentation

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 class '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.

Details

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

Author(s)

Michael Hahsler

See Also

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

Examples

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")

stream documentation built on May 29, 2024, 9:43 a.m.