Skip to content

Specially process or disallow tbl_ts input to new_epi_df #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
brookslogan opened this issue Aug 25, 2022 · 0 comments
Open

Specially process or disallow tbl_ts input to new_epi_df #221

brookslogan opened this issue Aug 25, 2022 · 0 comments
Labels
bug Something isn't working P3 very low priority

Comments

@brookslogan
Copy link
Contributor

devtools::load_all("/home/fullname/files/tooling/epiprocess/", export_all=FALSE)
#> ℹ Loading epiprocess
original_edf = new_epi_df(tibble::tibble(geo_value=1, time_value=1, age_value=1, value=1),
                          additional_metadata=list(other_keys="age_value"))
corresponding_tsibble = tsibble::as_tsibble(original_edf)
tsibble::key(corresponding_tsibble)
#> [[1]]
#> geo_value
#> 
#> [[2]]
#> age_value
recovered_edf = as_epi_df(corresponding_tsibble)
attr(recovered_edf, "metadata")$other_keys
#> [1] "age_value"
not_recovered_edf = new_epi_df(corresponding_tsibble)
attr(not_recovered_edf, "metadata")$other_keys
#> NULL

Created on 2022-08-25 by the reprex package (v2.0.1)

I think we'd prefer one of the following:

  • Raise an error if x is a tbl_ts.
  • Raise an error if x is a tbl_ts that has a tsibble::key including anything other than geo_value.
  • Make new_epi_df behave the same way as as_epi_df when given a tbl_ts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P3 very low priority
Projects
None yet
Development

No branches or pull requests

1 participant