@@ -92,7 +92,7 @@ test_that("epi_archives are correctly instantiated with a variety of data types"
92
92
expect_equal(key(ea1 $ DT ), c(" geo_value" , " time_value" , " version" ))
93
93
94
94
ea2 <- as_epi_archive(df , other_keys = " value" , compactify = FALSE )
95
- expect_equal(key(ea2 $ DT ), c(" geo_value" , " time_value " , " value " , " version" ))
95
+ expect_equal(key(ea2 $ DT ), c(" geo_value" , " value " , " time_value " , " version" ))
96
96
97
97
# Tibble
98
98
tib <- tibble :: tibble(df , code = " x" )
@@ -101,7 +101,7 @@ test_that("epi_archives are correctly instantiated with a variety of data types"
101
101
expect_equal(key(ea3 $ DT ), c(" geo_value" , " time_value" , " version" ))
102
102
103
103
ea4 <- as_epi_archive(tib , other_keys = " code" , compactify = FALSE )
104
- expect_equal(key(ea4 $ DT ), c(" geo_value" , " time_value " , " code " , " version" ))
104
+ expect_equal(key(ea4 $ DT ), c(" geo_value" , " code " , " time_value " , " version" ))
105
105
106
106
# Keyed data.table
107
107
kdt <- data.table :: data.table(
@@ -119,7 +119,7 @@ test_that("epi_archives are correctly instantiated with a variety of data types"
119
119
120
120
ea6 <- as_epi_archive(kdt , other_keys = " value" , compactify = FALSE )
121
121
# Mismatched keys, but the one from as_epi_archive overrides
122
- expect_equal(key(ea6 $ DT ), c(" geo_value" , " time_value " , " value " , " version" ))
122
+ expect_equal(key(ea6 $ DT ), c(" geo_value" , " value " , " time_value " , " version" ))
123
123
124
124
# Unkeyed data.table
125
125
udt <- data.table :: data.table(
@@ -134,7 +134,7 @@ test_that("epi_archives are correctly instantiated with a variety of data types"
134
134
expect_equal(key(ea7 $ DT ), c(" geo_value" , " time_value" , " version" ))
135
135
136
136
ea8 <- as_epi_archive(udt , other_keys = " code" , compactify = FALSE )
137
- expect_equal(key(ea8 $ DT ), c(" geo_value" , " time_value " , " code " , " version" ))
137
+ expect_equal(key(ea8 $ DT ), c(" geo_value" , " code " , " time_value " , " version" ))
138
138
139
139
# epi_df
140
140
edf1 <- cases_deaths_subset %> %
@@ -145,7 +145,7 @@ test_that("epi_archives are correctly instantiated with a variety of data types"
145
145
expect_equal(key(ea9 $ DT ), c(" geo_value" , " time_value" , " version" ))
146
146
147
147
ea10 <- as_epi_archive(edf1 , other_keys = " code" , compactify = FALSE )
148
- expect_equal(key(ea10 $ DT ), c(" geo_value" , " time_value " , " code " , " version" ))
148
+ expect_equal(key(ea10 $ DT ), c(" geo_value" , " code " , " time_value " , " version" ))
149
149
150
150
# Keyed epi_df
151
151
edf2 <- data.frame (
@@ -164,7 +164,7 @@ test_that("epi_archives are correctly instantiated with a variety of data types"
164
164
expect_equal(key(ea11 $ DT ), c(" geo_value" , " time_value" , " version" ))
165
165
166
166
ea12 <- as_epi_archive(edf2 , other_keys = " misc" , compactify = FALSE )
167
- expect_equal(key(ea12 $ DT ), c(" geo_value" , " time_value " , " misc " , " version" ))
167
+ expect_equal(key(ea12 $ DT ), c(" geo_value" , " misc " , " time_value " , " version" ))
168
168
})
169
169
170
170
test_that(" `epi_archive` rejects nonunique keys" , {
0 commit comments