X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=data%2Fscripts%2Fbuild_testdata.R;h=4c5978a25aac315df71bd8b92110e7e9324de2a3;hb=44a9990b6d608ffcd2e99d5193fa8b9e6cbdb436;hp=9bc4fa41d9f2344e00ed384f54cb4da51a62a08b;hpb=613a986f1517ab5a641771da62eba6c7f5a41577;p=talweg.git diff --git a/data/scripts/build_testdata.R b/data/scripts/build_testdata.R index 9bc4fa4..4c5978a 100644 --- a/data/scripts/build_testdata.R +++ b/data/scripts/build_testdata.R @@ -1,6 +1,16 @@ -# Only one covariable (so that the "matrix" is always invertible) +#Lundi à dimanche, 182 jours +dates = seq(as.Date("2007-01-01"),as.Date("2007-07-01"),"days") +times = strftime( seq( + from=ISOdatetime(2007,1,1,1,0,0,tz="GMT"), + to=ISOdatetime(2007,7,2,0,0,0,tz="GMT"), + by="hour"), tz="GMT" ) +# Only one covariable (so that the "matrix" is always invertible) +L = length(dates) #182 +exo_df = data.frame( "date"=dates, "var"=rep(1,L), "var_pred"=rep(1,L) ) # Series are 1,1,...,1 2,2,...,2 ... 7,7,...,7 1,1,...,1 ...etc -# First serie on monday 2007-01-01 +# First serie on monday 2007-01-01, there are exactly 26 weeks +ts_df = data.frame( "time"=times, "value"=rep(seq_len(7), each=24, times=26) ) -#TODO: +write.csv(ts_df, file="ts_test.csv", row.names=FALSE) +write.csv(exo_df, file="exo_test.csv", row.names=FALSE)