# 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)
dsd2
# clean up
close_stream(dsd2)
file.remove("data.txt")
# example with a part of the kddcup1999 data (take only cont. variables)
file <- system.file("examples", "kddcup10000.data.gz", package="stream")
dsd <- DSD_ReadStream(gzfile(file),
take=c(1, 5, 6, 8:11, 13:20, 23:41), assignment=42, k=7)
dsd
get_points(dsd,5)
# plot 100 points (projected on the first two principal components)
plot(dsd, n=100, method="pc")
close_stream(dsd)
Run the code above in your browser using DataLab