Skip to content

Commit b5cec01

Browse files
committed
Still having problems with non-similar xx1 and xx2.
1 parent 5062127 commit b5cec01

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

tests/testthat/test-epix_slide.R

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,23 @@ test_that("epix_slide works as intended",{
1717
binary = 2^(1:12)) %>%
1818
as_epi_archive()
1919

20-
time_values <- c(2,3:5)
21-
2220
xx1 <- epix_slide(x = xx,
23-
f = ~ sum(.xx$binary),
21+
f = ~ sum(.x$binary),
2422
before = 3,
2523
group_by = geo_value,
26-
ref_time_values = time_values,
2724
new_col_name = "sum_binary")
2825

29-
xx2 <- tibble(geo_value = rep("x",5),
30-
time_value = as.Date("2020-06-01") + 1:5,
31-
sum_binary = c(3))
26+
xx2 <- tibble(geo_value = rep("x",2),
27+
time_value = c(5,6),
28+
sum_binary = c(2^7,
29+
2^10+2^8)) %>%
30+
as_epi_df()
3231

3332
expect_identical(xx1,xx2) # *
3433

35-
xx3 <- xx$slide(f = ~ sum(.xx$binary),
34+
xx3 <- xx$slide(f = ~ sum(.x$binary),
3635
before = 3,
3736
group_by = "geo_value",
38-
ref_time_values = time_values,
3937
new_col_name = 'sum_binary')
4038

4139
expect_identical(xx1,xx3) # This and * Imply xx2 and xx3 are identical

0 commit comments

Comments
 (0)