Closed GregorDeCillia closed 3 months ago
There is now a first implementation which allows to set filters
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")
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
```r library(STATcubeR) schema <- sc_schema_db("detouextregsai") region <- schema$`Other Classifications`$ `Tourism commune [ABO]`$`Regionale Gliederung (Ebene +1)` request <- list( database = schema$id, dimensions = list(I(region$id)), recodes = setNames( list(list( map = list( I(region$Bregenzerwald$id), I(region$`Vorarlberg Rest`$id), I(region$`Bodensee-Vorarlberg`$id) ) )), region$id ) ) jsonlite::write_json(request, "request.json", pretty = TRUE, auto_unbox = TRUE) readLines("request.json") %>% cat(sep = "\n") x <- sc_table("request.json", add_totals = FALSE) x$tabulate() ```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 this