Learn R Programming

stream (version 0.1-1)

DSD_ScaleStream: Scale a Stream from a DSD

Description

A DSD class that wraps a DSD and scales it.

Usage

DSD_ScaleStream(dsd,  
                  center=TRUE, scale=TRUE,
                  n=1000)

Arguments

dsd
A object of class DSD that will be scaled.
center, scale
logical or a numeric vector of length equal to the number of columns used for centering/scaling
n
The number of points used to creating the centering/scaling

Value

  • An object of class DSD_ScaleStream (subclass of DSD_R, DSD).

Details

scale_stream() estimates the values for centering and scaling (see scale in base) using n points from the stream.

See Also

DSD, reset_stream, scale in base,

Examples

Run this code
# creating data and writing it to disk
  dsd <- DSD_GaussianStatic(k=3, d=5)
  write_stream(dsd, "data.txt", n=100, sep=",")
  
  # reading the same data back (as a loop)
  dsd2 <- DSD_ReadStream("data.txt", sep=",", loop=TRUE)
  plot(dsd2)
  
  dsd3 <- DSD_ScaleStream(dsd2)
  plot(dsd3)
  
  # clean up
  close_stream(dsd2)
  file.remove("data.txt")

Run the code above in your browser using DataLab