'update'
[epclust.git] / epclust / R / utils.R
CommitLineData
5c652979
BA
1toInteger <- function(x, condition)
2{
3 if (!is.integer(x))
4 tryCatch(
5 {x = as.integer(x)[1]},
6 error = function(e) paste("cannot convert argument",substitute(x),"to integer")
7 )
8 if (!condition(x))
9 stop(paste("argument",substitute(x),"does not verify condition",body(condition)))
10 x
11}
12
c33af7e4 13serialize = function(coeffs, file, append)
5c652979
BA
14{
15 #.........
16 #C function (from data.frame, type of IDs ??! force integers ? [yes])
17 #return raw vector
5c652979 18 #take raw vector, append it (binary mode) to a file
7b13d0c2 19#TODO: appendCoeffs() en C --> serialize et append to file
5c652979
BA
20}
21
c33af7e4 22deserialize = function(file, range, serie_length)
5c652979
BA
23{
24 #......
25 #C function (from file name)
26}
27
28getSeries(data, rank=NULL, id=NULL)
29{
30 #TODO:
31}
32
33getCoeffs(.....) #FROM BINARY FILE !!!
34{
35
36}