You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From discussion from #185. Operations such as [ can remove essential columns from an epi_df, so we decay from an epi_df to a tibble; however, the metadata sticks around, and some of it doesn't make sense.
library(dplyr)
#> #> Attaching package: 'dplyr'#> The following objects are masked from 'package:stats':#> #> filter, lag#> The following objects are masked from 'package:base':#> #> intersect, setdiff, setequal, union
library(epiprocess)
#> #> Attaching package: 'epiprocess'#> The following object is masked from 'package:stats':#> #> filterdecayed=
new_epi_df(tibble(geo_value="ak",time_value=1L,value=1L)) #%>%#select(-geo_value)decayed[-1]
#> # A tibble: 1 × 2#> time_value value#> <int> <int>#> 1 1 1decayed[-1] %>% attr("metadata")
#> $geo_type#> [1] "state"#> #> $time_type#> [1] "custom"#> #> $as_of#> [1] "2022-08-08 09:15:22 PDT"
Here, geo_type doesn't make sense. We didn't have any other_keys to begin with, but if we did, they might not make sense either. In other cases, different metadata will be invalidated. We might want to just drop all the metadata in all cases to keep it simple.
Marking as P3 as the presence of metadata that doesn't make sense on a tibble shouldn't affect its operation, and if we convert back to an epi_df using {new,as}_epi_df, it looks like the only metadata that will be carried over is as_of, which might or might not make sense depending on what intermediate operations have occurred. We should probably make it easier to override this as_of setting, though (intersects with #166).
The text was updated successfully, but these errors were encountered:
Modified the above ex. to explicitly use indexing to make sure goes through [.epi_df. As discussed, will go for the simplest soln to drop all metadata.
From discussion from #185. Operations such as
[
can remove essential columns from anepi_df
, so we decay from anepi_df
to atibble
; however, the metadata sticks around, and some of it doesn't make sense.Created on 2022-08-08 by the reprex package (v2.0.1)
Here,
geo_type
doesn't make sense. We didn't have anyother_keys
to begin with, but if we did, they might not make sense either. In other cases, different metadata will be invalidated. We might want to just drop all the metadata in all cases to keep it simple.Marking as P3 as the presence of metadata that doesn't make sense on a tibble shouldn't affect its operation, and if we convert back to an
epi_df
using{new,as}_epi_df
, it looks like the only metadata that will be carried over isas_of
, which might or might not make sense depending on what intermediate operations have occurred. We should probably make it easier to override thisas_of
setting, though (intersects with #166).The text was updated successfully, but these errors were encountered: