Skip to content
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

Time type: Week #15

Closed
GregorDeCillia opened this issue Aug 10, 2021 · 1 comment
Closed

Time type: Week #15

GregorDeCillia opened this issue Aug 10, 2021 · 1 comment
Labels
feature New feature or request parse time
Milestone

Comments

@GregorDeCillia
Copy link
Contributor

As mentioned in #11 (more precisely: here), it would be useful to add a new "Week" type for time variables. The dataset od_table("OGD_gest_kalwo_alter_GEST_KALWOCHE_5J_100") uses codes of the form {prefix}-YYYYWW for the time variable where WW is the calendar week. This is very similar to the {prefix}-YYYYMM notation for months which is why the following table fails at parsing the time correctly.

x <- od_table("OGD_gest_kalwo_alter_GEST_KALWOCHE_5J_100")
x$raw$extras$metadata_modified
#> [1] "2021-07-22T09:02:59"
x$meta$fields[, c(1, 3, 4, 5)]
#>   code         label_en                           nitems type        
#> 1 C-KALWOCHE-0 Calendar week                        1121 Time (month)
#> 2 C-B00-0      Province (NUTS 2 unit) of deceased      9 Category    
#> 3 C-ALTER5-0   5 years age group of deceased          20 Category    
#> 4 C-C11-0      Gender of deceased                      2 Category   
x$field("Calendar week")[11:14, c(1, 3, 4)]
#>   code        label_en                                                  parsed    
#> 2 KALW-200011 11. Calendar week 2000 (week from 13.3.2000 to 19.3.2000) 2000-11-01
#> 3 KALW-200012 12. Calendar week 2000 (week from 20.3.2000 to 26.3.2000) 2000-12-01
#> 4 KALW-200013 13. Calendar week 2000 (week from 27.3.2000 to 2.4.2000)  NA        
#> 5 KALW-200014 14. Calendar week 2000 (week from 3.4.2000 to 9.4.2000)   NA        

Implementing this will require modifications in

sc_field_parse_time <- function(field) {
and also sc_fields_type()

@GregorDeCillia GregorDeCillia added feature New feature or request time parse labels Aug 10, 2021
@GregorDeCillia GregorDeCillia added this to the Version 1.0 milestone Aug 19, 2021
@GregorDeCillia
Copy link
Contributor Author

The same problem occurs with OGD_rate_kalwobez_GEST_KALWOCHE_STR_BZ_100.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request parse time
Projects
None yet
Development

No branches or pull requests

1 participant