Skip to content

Release 0.5.2#36

Merged
emilmalta merged 37 commits into
StatisticsGreenland:masterfrom
emilmalta:master
May 13, 2026
Merged

Release 0.5.2#36
emilmalta merged 37 commits into
StatisticsGreenland:masterfrom
emilmalta:master

Conversation

@emilmalta

Copy link
Copy Markdown
Collaborator

Release 0.5.2

Bumps version 0.5.1 → 0.5.2. Substantial release — main theme is unifying
the statgl_table() / statgl_crosstable() argument surface and giving
both first-class htmlwidget integration on par with statgl_plot().

Highlights

Tables

  • statgl_table() and statgl_crosstable() now share a common styling
    surface: .caption, .bottom_rule, .bold_rows, .digits,
    .hide_mobile work on both.
  • Both return an htmlwidget by default — opens in the RStudio Viewer,
    renders in knitr / Quarto, substitutes into shortcode params.
    .as_html = TRUE retained as an escape hatch.
  • statgl_crosstable() produces nested column headers for 3+ grouping
    variables (instead of dash-uniting labels into one row).
  • .value defaults to auto-detect: uses a value column when present,
    falls back to dplyr::n() row counts otherwise — so
    statgl_crosstable(ggplot2::mpg, manufacturer) now Just Works.

Plot

  • New pyramid argument for population-pyramid layouts.
  • New highlight argument — emphasises matched series / bars in accent
    orange, everything else neutral grey.
  • New legend_position argument ("top" / "bottom" / "left" /
    "right"; anything else hides the legend).
  • ... now forwards to highcharter::hchart().
  • Warns on negative y values (skipped for pyramid input).

Fetch

  • Auto-wraps scalar wildcards: gender = "*", time = "*0" now work
    without explicit px_all().
  • New .lang, .api_url, .dry_run arguments.
  • top() exported as a short alias for px_top().
  • statgl_api_url() now exported.

Heads-up — behavior changes

  • statgl_plot()'s show_last_value default flips from TRUE to
    FALSE (was noisy on grouped / bar charts).
  • .replace_0s = TRUE in statgl_table() now produces an en-dash;
    pass .replace_0s = "[-]{}" to keep the old Quarto-shortcode output.
  • statgl_crosstable() with a single grouping variable no longer
    emits the redundant spanning header row above col.names.
  • .drop / .value / .replace_nas validation tightened — malformed
    inputs warn or error clearly instead of silently no-op'ing.

Deprecations

  • statgl_crosstable(): .secondary.drop (filter; warn).
  • statgl_table(): .secondary.hide_mobile (CSS hide; warn).
  • statgl_fetch(): url argument now errors (was warn since 0.2.0).
  • statgl_fetch(): .chunk_size removed (was a non-functional
    placeholder).
  • statgl_crosstable(): .replace_nas = TRUE deprecated — pass
    .replace_nas = "." to keep prior behavior.

Bug fixes

  • statgl_url("bexst1") now matches statgl_url("BEXST1") (no more
    malformed search IDs from mixed-case input).

Internal

  • ~350 lines of unreachable chunking helpers removed from
    statgl_fetch(); logic extracted into single-purpose testable helpers.
  • chunk_large_query() no longer double-POSTs the first chunk.
  • Dropped purrr from Imports.

See NEWS.md for the full list.

Checks

  • devtools::check() passes
  • NEWS.md updated
  • Version bumped in DESCRIPTION

emilmalta and others added 30 commits May 7, 2026 23:59
…ce_0s and .replace_nas across table functions
Previously, calling statgl_crosstable() on a data frame without a
`value` column produced an opaque dplyr error about quosures. We
now check up-front and stop with a message that names the missing
column and lists what is available, e.g.

  Error: Column `value` not found in `df`. Pass `.value = <column>`
  to choose the cell-value column. Available columns: ...

Two offline tests cover the default and explicit-typo paths. An
end-to-end test on a non-PXWeb data frame (ggplot2::mpg) is deferred
to the upcoming .value auto-fallback commit.
@emilmalta emilmalta merged commit 4c143d3 into StatisticsGreenland:master May 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant