Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
S3 methods for streaming modelling with R package stream and for data in an ffdf
DSD_FFDFstream <- function(x, k=NA, assignment=NULL, loop=FALSE) {
stopifnot(is.ffdf(x))
open(x)
state <- new.env()
assign("counter", 1L, envir = state)
l <- list(description = "FF Data Stream",
strm = x,
state = state,
d = ncol(x),
k = k,
assignment = assignment,
loop = loop)
class(l) <- c("DSD_FFDFstream","DSD_R","DSD")
l
}
get_points.DSD_FFDFstream <- function(x, ...){
stream:::get_points.DSD_Wrapper(x, ...)
}
print.DSD_FFDFstream <- function(x, ...) {
NextMethod() # calling the super classes print()
pos <- x$state$counter
if (pos>nrow(x$strm))
if (!x$loop) pos <- "'end'" else pos <- 1
cat(paste('Contains', nrow(x$strm),
'data points - currently at position', pos,
'- loop is', x$loop, '\n'))
}
reset_stream.DSD_FFDFstream <- function(dsd) {
stream:::reset_stream.DSD_Wrapper(dsd)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.