projects
/
talweg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix bugs
[talweg.git]
/
pkg
/
R
/
getData.R
diff --git
a/pkg/R/getData.R
b/pkg/R/getData.R
index
f1f8861
..
8e44a52
100644
(file)
--- a/
pkg/R/getData.R
+++ b/
pkg/R/getData.R
@@
-62,11
+62,14
@@
getData = function(ts_data, exo_data, date_format="%d/%m/%Y %H:%M", limit=Inf)
{
time = c()
serie = c()
{
time = c()
serie = c()
+ level_hat = c()
repeat
{
{
time = c(time, ts_df[line,1])
serie = c(serie, ts_df[line,2])
repeat
{
{
time = c(time, ts_df[line,1])
serie = c(serie, ts_df[line,2])
+ level_hat = c(level_hat, #if data file is incomplete...
+ ifelse(ncol(ts_df) > 2, ts_df[line,3], mean(serie,na.rm=TRUE)))
line = line + 1
};
if (line >= nb_lines + 1
line = line + 1
};
if (line >= nb_lines + 1
@@
-76,8
+79,7
@@
getData = function(ts_data, exo_data, date_format="%d/%m/%Y %H:%M", limit=Inf)
}
}
}
}
- # TODO: 2 modes, "operational" and "testing"; would need PM10 predictions
- data$append(time=time, value=serie, level_hat=mean(serie,na.rm=TRUE),
+ data$append(time=time, value=serie, level_hat=level_hat,
exo=exo_df[i,2:(1+nb_exos)], exo_hat=exo_df[i,(1+nb_exos+1):(1+2*nb_exos)])
if (i >= limit)
break
exo=exo_df[i,2:(1+nb_exos)], exo_hat=exo_df[i,(1+nb_exos+1):(1+2*nb_exos)])
if (i >= limit)
break