9786097d3385aa6579a942083be1d03a301168b8
[talweg.git] / pkg / tests / testthat / test.dateIndexToInteger.R
1 context("Check that dateIndexToInteger behaves as expected")
2
3 test_that("integer index matches date in data",
4 {
5
6
7
8 #TODO: with and without shift at origin (so series values at least forst ones are required)
9
10
11 n = 1500
12 series = list()
13 for (i in seq_len(n))
14 {
15 index = (i%%3) + 1
16 level = mean(s[[index]])
17 serie = s[[index]] - level + rnorm(L,sd=0.05)
18 # 10 series with NAs for index 2
19 if (index == 2 && i >= 60 && i<= 90)
20 serie[sample(seq_len(L),1)] = NA
21 series[[i]] = list("level"=level,"serie"=serie) #no need for more :: si : time !!!
22 }
23 data = new("Data", data=series)
24
25 dateIndexToInteger = function(index, data)
26 })