Learn R Programming

stream (version 1.5-1)

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,
  write_outliers = FALSE,
  ...
)

Value

There is no value returned from this operation.

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.

append

Append the data to an existing file.

sep

The character that will separate attributes in a data point.

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.

write_outliers

A flag that determines if outliers will be output.

...

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

Author

Michael Hahsler, Dalibor Krleža

See Also

Examples

Run this code

# creating data and writing it to disk
stream <- DSD_Gaussians(k=3, d=5, outliers=1,
  outlier_options=list(outlier_horizon=10))
write_stream(stream, file="data.txt", n=10, class=TRUE, write_outliers=TRUE)

#file.show("data.txt")

# clean up
file.remove("data.txt")

Run the code above in your browser using DataLab