## About this package
packageDescription("Streamer")
## Existing stream components
getClass("Producer") # Producer classes
getClass("Consumer") # Consumer classes
## An example
fl <- system.file("extdata", "s_1_sequence.txt", package="Streamer")
b <- RawInput(fl, 100L, reader=rawReaderFactory(1e4))
s <- Stream(RawToChar(), Rev(), b)
s
head(yield(s)) # First chunk
close(b)
b <- RawInput(fl, 5000L, verbose=TRUE)
d <- Downsample(sampledSize=50)
s <- Stream(RawToChar(), d, b)
s
s[[2]]
## Processing the first ten chunks of the file
i <- 1
while (10 >= i && 0L != length(chunk <- yield(s)))
{
cat("chunk", i, "length", length(chunk), "\n")
i <- i + 1
}
close(b)
Run the code above in your browser using DataLab