@@ -7,11 +7,10 @@ toy_epi_df <- tibble::tibble(
77 length.out = 5
88 ), times = 2 ),
99 geo_value = rep(c(" ca" , " hi" ), each = 5 ),
10- additional_key_val = as.factor(rep(1 : 2 , times = 5 )),
11- ) %> % epiprocess :: as_epi_df()
10+ indicator_var = as.factor(rep(1 : 2 , times = 5 )),
11+ ) %> % epiprocess :: as_epi_df(additional_metadata =
12+ c(other_keys = " indicator_var" ))
1213
13- attributes(toy_epi_df )$ metadata $ additional_metadata <-
14- list (additional_key_name = " additional_key_type" )
1514att_toy = attr(toy_epi_df , " metadata" )
1615
1716test_that(" head and tail do not drop the epi_df class" , {
@@ -23,13 +22,11 @@ test_that("head and tail do not drop the epi_df class", {
2322 expect_identical(att_head $ geo_type , att_toy $ geo_type )
2423 expect_identical(att_head $ time_type , att_toy $ time_type )
2524 expect_identical(att_head $ as_of , att_toy $ as_of )
26- expect_identical(att_head $ additional_key_name ,
27- att_toy $ additional_metadata $ additional_key_name )
25+ expect_identical(att_head $ other_keys , att_toy $ other_keys )
2826 expect_identical(att_tail $ geo_type , att_toy $ geo_type )
2927 expect_identical(att_tail $ time_type , att_toy $ time_type )
3028 expect_identical(att_tail $ as_of , att_toy $ as_of )
31- expect_identical(att_tail $ additional_key_name ,
32- att_toy $ additional_metadata $ additional_key_name )
29+ expect_identical(att_tail $ other_keys , att_toy $ other_keys )
3330})
3431
3532
@@ -45,8 +42,7 @@ test_that("subsetting drops or does not drop the epi_df class appropriately", {
4542 expect_identical(att_row_subset $ geo_type , att_toy $ geo_type )
4643 expect_identical(att_row_subset $ time_type , att_toy $ time_type )
4744 expect_identical(att_row_subset $ as_of , att_toy $ as_of )
48- expect_identical(att_row_subset $ additional_key_name ,
49- att_toy $ additional_metadata $ additional_key_name )
45+ expect_identical(att_row_subset $ other_keys , att_toy $ other_keys )
5046
5147 # Col subset - shouldn't be an epi_df
5248 col_subset = toy_epi_df [, 2 : 3 ]
@@ -73,7 +69,6 @@ test_that("subsetting drops or does not drop the epi_df class appropriately", {
7369 expect_identical(att_row_col_subset2 $ geo_type , att_toy $ geo_type )
7470 expect_identical(att_row_col_subset2 $ time_type , att_toy $ time_type )
7571 expect_identical(att_row_col_subset2 $ as_of , att_toy $ as_of )
76- expect_identical(att_row_col_subset2 $ additional_key_name ,
77- att_toy $ additional_metadata $ additional_key_name )
72+ expect_identical(att_row_col_subset2 $ other_keys , att_toy $ other_keys )
7873
7974})
0 commit comments