-
Notifications
You must be signed in to change notification settings - Fork 1
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
allow recoding of sc_data objects #18
Conversation
The initial version only works with open data and recodes are only applied when the language is set explicitly. Example x <- od_table("OGD_krebs_ext_KREBS_1")
x$recode$
label_field("C-KRE_GESCHLECHT-0", "en", "SEX")$
label_measure("F-KRE", "en", "NUMBER")$
level("C-KRE_GESCHLECHT-0", "GESCHLECHT-1", "en", "MALE")
x$language <- "en"
x$tabulate("C-KRE_GESCHLECHT-0", "F-KRE") |
currently, this has no effect on labeling
right now, there is a redundancy with $language in od_table, but $language will be moved to the base class and then it is required that no labels are empty
The recodes shoud also work with API tables now x <- sc_table(json_file = sc_example("population_timeseries.json"))
x$recode$
label_field("C-BESC11-0", "en", "SEX")$
label_measure("F-ISIS-1", "en", "PERSONS")$
level("C-BESC11-0", "1", "en", "MALE")
x$tabulate("C-BESC11-0") Also the line |
Recoding operations that should be supported
|
this is now handeled by the base class
this now works earnings <- od_table("OGD_veste309_Veste309_1")
earnings$recode$
total_codes("C-A11-0", "A11-1")$
total_codes("C-STAATS-0", "STAATS-9")$
total_codes("C-VEBDL-0", "VEBDL-10")$
total_codes("C-BESCHV-0", "BESCHV-1")
earnings$total_codes() |
also, remove unused argument
It might make more sense to set the visibility automatically via Lines 22 to 26 in 1d62a43
|
It turns out we also need a way to import both languages (german and english) into one Lines 184 to 185 in 4175326
We could either add a new language option x <- sc_example("accomodation") %>% sc_table(language = "en")
x$recode$add_language("de") The In any case this requires an additional request against the |
The pop <- sc_example("pop") %>% sc_table(language = "en")
pop$add_language("de")
pop
#> An object of class sc_table
#>
#> Database Population at the beginning of the quarter since 2002
#> Measures Number of persons
#> Fields Quarter, Age in single years <96>, Sex <2>, Commune <2383> (Province-District)
#>
#> Request 2021-08-30 08:01:02
#> STATcubeR 0.2.5
pop$language <- "de"
pop
#> An object of class sc_table
#>
#> Database Bevölkerung zu Quartalsbeginn ab 2002
#> Measures Anzahl der Personen
#> Fields Quartal, Alter in Einzeljahren, Geschlecht, Gemeinde (Vergröberung über Politischen Bezirk)
#>
#> Request 2021-08-30 08:01:02
#> STATcubeR 0.2.5 |
for convenience, this makes two requests against table and returns both languages in one object
the param language now behaves differently for sc_table compared to other REST API functions
if present, this language will be used for labelling the dataset. Otherwise table$language is used
Format: YYYY-WW with an isoweek in WW closes #15
Closing this because soon we will add some updates that are unrelated to the recoder class. The documentation of the new features is currently limited to the class reference which schuld be enough for now. |
Allow recoding such as changing labels via a recode method
closes #17