Skip to content

Commit 7273781

Browse files
Update tests/testthat/test-arrange-canonical.R
resolve suggestions Co-authored-by: brookslogan <[email protected]>
1 parent ac62ddb commit 7273781

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
test_that("canonical arrangement works", {
22
tib <- tibble(
33
x = 1:8,
4-
y = rep(c("b", "b", "a", "a"), times = 2),
4+
demo_grp = rep(c("b", "b", "a", "a"), times = 2),
55
geo_value = rep(c("ga", "ca"), each = 4),
66
time_value = rep(2:1, times = 4)
77
)
88
expect_warning(arrange_canonical(tib))
99

10-
tib <- tib %>% as_epi_df(additional_metadata = list(other_keys = "y"))
11-
expect_equal(names(tib), c("geo_value", "time_value", "x", "y"))
10+
tib <- tib %>% as_epi_df(additional_metadata = list(other_keys = "demo_grp"))
11+
expect_equal(names(tib), c("geo_value", "time_value", "x", "demo_grp"))
1212

1313
tib_sorted <- arrange_canonical(tib)
14-
expect_equal(names(tib_sorted), c("geo_value", "time_value", "y", "x"))
14+
expect_equal(names(tib_sorted), c("geo_value", "time_value", "demo_grp", "x"))
1515
expect_equal(tib_sorted$geo_value, rep(c("ca", "ga"), each = 4))
1616
expect_equal(tib_sorted$time_value, c(1, 1, 2, 2, 1, 1, 2, 2))
17-
expect_equal(tib_sorted$y, rep(letters[1:2], times = 4))
17+
expect_equal(tib_sorted$demo_grp, rep(letters[1:2], times = 4))
1818
expect_equal(tib_sorted$x, c(8, 6, 7, 5, 4, 2, 3, 1))
1919
})

0 commit comments

Comments
 (0)