Open dsweber2 opened 3 months ago
The other_keys
are reflected in the DT's key. Does seem a bit unnatural to access. The solution may be an other_keys()
or get_other_keys()
method that works on both epi_df
s and epi_archive
s. I'd also like an epi_keys()
/ get_epi_keys()
method, but that already exists in epipredict with a different meaning than I would have assigned (time_value
is included for epi_df
s, and maybe there's not an archive impl yet), and not sure what other name to use for what I'd have called epi_keys
(= geo_value, !!!other_keys for both epi_dfs and epi_archives).
Is there anywhere internally where we try to pull $other_keys
/ [["other_keys"]]
? I don't see any right now in (a recent version of) epiprocess.
The solution may be an other_keys() or get_other_keys() method that works on both epi_dfs and epi_archives
remembering attributes(x)$metadata
always adds friction for me, so I'd definitely like this feature.
what other name to use for what I'd have called epi_keys
maybe non_time_keys
? fwiw, I would have assumed epi_keys
meant the entire index, and not just some subset of it.
Is there anywhere internally where we try to pull $other_keys / [["other_keys"]]? I don't see any right now in (a recent version of) epiprocess.
I also can't find any examples for epi_archive
. There's a couple for epi_df
:
./R/key_colnames.R:27: other_keys <- attr(x, "metadata")$other_keys
./R/key_colnames.R:33: other_keys <- attr(x, "metadata")$other_keys
./R/methods-epi_df.R:31: if (missing(key)) key <- c("geo_value", attributes(x)$metadata$other_keys)
./R/methods-epi_df.R:165: old_other_keys <- attr(template, "metadata")$other_keys
./R/methods-epi_df.R:166: attr(res, "metadata")$other_keys <- old_other_keys[old_other_keys %in% cn]
./R/epi_df.R:307: additional_metadata$other_keys <- unique(
./R/epi_df.R:308: c(additional_metadata$other_keys, tsibble_other_keys)
Apparently not intended behavior. The underlying
DT
has the right keys, it's just not recorded in metadata at allWorking example