@@ -6,12 +6,13 @@ test_that("epix_slide only works on an epi_archive",{
66
77test_that(" epix_slide works as intended" ,{
88 x <- tibble :: tribble(~ version , ~ time_value , ~ binary ,
9- 5 , c(1 : 2 ,4 ), 2 ^ (1 : 3 ),
10- 6 , c(1 : 2 ,4 : 5 ), 2 ^ (4 : 7 ),
11- 7 , 2 : 6 , 2 ^ (8 : 12 )) %> %
9+ 4 , c(1 : 3 ), 2 ^ (1 : 3 ),
10+ 5 , c(1 : 2 ,4 ), 2 ^ (4 : 6 ),
11+ 6 , c(1 : 2 ,4 : 5 ), 2 ^ (7 : 10 ),
12+ 7 , 2 : 6 , 2 ^ (11 : 15 )) %> %
1213 tidyr :: unnest(c(time_value ,binary ))
1314
14- xx <- bind_cols(geo_value = rep(" x" ,12 ), x ) %> %
15+ xx <- bind_cols(geo_value = rep(" x" ,15 ), x ) %> %
1516 as_epi_archive()
1617
1718 xx1 <- epix_slide(x = xx ,
@@ -20,11 +21,12 @@ test_that("epix_slide works as intended",{
2021 group_by = geo_value ,
2122 new_col_name = " sum_binary" )
2223
23- xx2 <- tibble(geo_value = rep(" x" ,2 ),
24+ xx2 <- tibble(geo_value = rep(" x" ,3 ),
2425 # 7 should also be there below; this is a bug on issue #153
25- time_value = c(5 ,6 ),
26- sum_binary = c(2 ^ 3 ,
27- 2 ^ 7 + 2 ^ 6 )) %> %
26+ time_value = c(4 ,5 ,6 ),
27+ sum_binary = c(2 ^ 3 + 2 ^ 2 ,
28+ 2 ^ 6 + 2 ^ 5 ,
29+ 2 ^ 10 + 2 ^ 9 )) %> %
2830 as_epi_df(as_of = 1 ) # Also a bug (issue #213)
2931
3032 expect_identical(xx1 ,xx2 ) # *
0 commit comments