toInteger <- function(x, condition) { if (!is.integer(x)) tryCatch( {x = as.integer(x)[1]}, error = function(e) paste("cannot convert argument",substitute(x),"to integer") ) if (!condition(x)) stop(paste("argument",substitute(x),"does not verify condition",body(condition))) x } #TODO: merge these 2 next ?! serialize = function(coeffs) { #......... #C function (from data.frame, type of IDs ??! force integers ? [yes]) #return raw vector } appendBinary = function(.......) { #take raw vector, append it (binary mode) to a file } #finalizeSerialization = function(...) #{ # #write number of series, and length of each... #} deserialize = function(coeffs, range) { #...... #C function (from file name) } getSeries(data, rank=NULL, id=NULL) { #TODO: } getCoeffs(.....) #FROM BINARY FILE !!! { }