-
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
filters in sc_table_custom() #33
Comments
5 tasks
There is now a first implementation which allows to set filters STATcubeR usageschema <- sc_schema_db("detouextregsai")
region <- schema$`Other Classifications`$`Tourism commune [ABO]`$
`Regionale Gliederung (Ebene +1)`
month <- schema$`Mandatory fields`$`Season/Tourism Month`
x <- sc_table_custom(
schema,
schema$Facts$Arrivals,
list(month, region),
recodes = c(
sc_recode(region, total = FALSE, map = list(
region$Achensee,
list(region$Arlberg, region$`Ausseerland-Salzkammergut`)
)),
sc_recode(month, total = FALSE)
)
)
x$tabulate() resulting data.frame
resulting API request{
"database": "str:database:detouextregsai",
"measures": [
"str:statfn:detouextregsai:F-DATA1:F-ANK:SUM",
"str:measure:detouextregsai:F-DATA1:F-UEB"
],
"dimensions": [
[
"str:field:detouextregsai:F-DATA1:C-SDB_TIT-0"
],
[
"str:valueset:detouextregsai:F-DATA1:C-C93-2:C-C93SUM-0"
]
],
"recodes": {
"str:field:detouextregsai:F-DATA1:C-SDB_TIT-0": {
"total": true
},
"str:valueset:detouextregsai:F-DATA1:C-C93-2:C-C93SUM-0": {
"total": true
}
}
} This feature is currently only available in the development branch #32 . For anyone interested, the package can be instlled from the dev-branch. However, these new features are likely to be refactored before #32 is merged. remotes::install_github("statistikat/STATcubeR", ref = "tibble_pkg") |
GregorDeCillia
added a commit
that referenced
this issue
Dec 9, 2022
there are now several checks in place that throw warnings if inputs in sc_table_custom() or sc_recode() are of the wrong schema-type or if other inconsistencies are suspected. See the section called "error handling" in ?sc_table_custom for more details some of those warnings might be replaced with errors in the future part of #33
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There have now been several requests to support filtering in
sc_table_custom()
. Currently, the only way to do this is to generate therequest.json
by hand.Example
It might be sensible to extend the functionality of
sc_table_custom()
to support filters (or possibly other recodes) via additional parameters. The syntax might look like thisThe text was updated successfully, but these errors were encountered: