Changelog
Source:NEWS.md
statswalesr 1.0.0
CRAN release: 2026-07-12
- Migrated to StatsWales API v2 (
https://api.stats.gov.wales/v2) - Added a
sort_byargument tostatswales_get_dataset(),statswales_get_pivot(), andstatswales_get_topic(). Accepts either a"column:direction"string or a named vector likec(Year = "desc") -
statswales_get_filters()now flattens hierarchical dimensions: thevaluesdata frame gainsparentandlevelcolumns so nested values (e.g. Wales → local authorities → wards) are fully represented -
statswales_get_dataset()now uses a two-step POST + GET flow; filters use the newlist(list(ColumnName = c("ref1", "ref2")))format and human-readable column names/values are returned by default -
statswales_search()restored with full-text search across dataset titles and summaries; supportsmodeargument (basic,fts,fuzzy, etc.) -
statswales_get_filters()path updated to/{id}/filters -
statswales_download_dataset()now uses the POST + GET filter ID flow;formatis a query parameter rather than a URL path segment - New
statswales_get_pivot()for cross-tabulated pivot views - New
statswales_create_query()to generate a reusable filter ID - New
statswales_get_query()to inspect a stored query configuration (total row count, column mappings, applied filters) -
statswales_get_dataset()results are now tidied for analysis by default: internal*_sortcolumns are dropped, whitespace padding is stripped, and numeric-looking columns (including data values) are converted to numeric. Settidy = FALSEfor the raw API response -
statswales_get_dataset()now returns the entire dataset by default (all_pages = TRUE); setall_pages = FALSEfor single-page retrieval. The defaultpage_sizewas also raised from 100 to 10000 (the API maximum), so most datasets arrive in a single request -
statswales_list_datasets()now fetches the full dataset catalogue automatically; thepage_numberandpage_sizearguments were removed - Timestamp columns from
statswales_list_datasets()andstatswales_search()are nowPOSIXct(UTC) instead of character - All API requests now retry transient failures (up to 3 attempts)
statswalesr 0.4.0
- Complete rewrite for the new StatsWales public API (
https://api.stats.gov.wales/v1) - Dataset IDs are now UUIDs returned by the API; old alphanumeric codes no longer apply
- New functions:
statswales_list_datasets(),statswales_list_topics(),statswales_get_topic(),statswales_get_filters(),statswales_download_dataset() -
statswales_get_dataset()now calls the paginated view endpoint and returns a data frame; setall_pages = TRUEto auto-fetch all pages -
statswales_get_metadata()restored — returns full dataset metadata including revision history - Removed all deprecated functions and their dependencies (
lifecycle,rlang,curl,readr,httr) - Replaced
httrwithhttr2; addedjsonliteas a dependency - Requires R >= 4.1.0
statswalesr 0.3.0
- All functions deprecated except statswales_get_dataset() due to end of OData service
- ‘readr’ and ‘lifecycle’ added as dependencies
statswalesr 0.2.0
CRAN release: 2022-04-03
- Welsh language options are now available across the three statswalesr functions
statswalesr 0.1.4
CRAN release: 2021-07-14
- a couple of minor fixes have been made to the package’s unit tests