Skip to content

epi_archive$other_keys is empty  #459

@dsweber2

Description

@dsweber2

Apparently not intended behavior. The underlying DT has the right keys, it's just not recorded in metadata at all

Working example

dv <- pub_covidcast(
  source = "doctor-visits",
  signals = "smoothed_adj_cli",
  geo_type = "state",
  time_type = "day",
  geo_values = "ca,fl,ny,tx",
  time_values = epirange(20200601, 20211201),
  issues = epirange(20200601, 20211201)
)
archive <- dv %>%
  select(geo_value, time_value, version = issue, lag, percent_cli = value) %>%
  as_epi_archive(compactify = TRUE, other_keys = c("lag"))
> archive$DT
Key: <geo_value, time_value, lag, version>
        geo_value time_value    version   lag percent_cli
           <char>     <Date>     <Date> <num>       <num>
     1:        ca 2020-06-01 2020-06-06     5    2.140116
     2:        ca 2020-06-01 2020-06-07     6    2.140116
     3:        ca 2020-06-01 2020-06-08     7    2.140379
     4:        ca 2020-06-01 2020-06-09     8    2.114430
     5:        ca 2020-06-01 2020-06-10     9    2.133677
    ---                                                  
117144:        tx 2021-11-23 2021-11-29     6    2.159704
117145:        tx 2021-11-24 2021-11-27     3    2.024028
117146:        tx 2021-11-24 2021-11-29     5    1.937911
117147:        tx 2021-11-25 2021-11-29     4    1.866631
117148:        tx 2021-11-26 2021-11-29     3    1.858596

> names(archive)
[1] "DT"                         "geo_type"                  
[3] "time_type"                  "additional_metadata"       
[5] "clobberable_versions_start" "versions_end"              

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions