Skip to contents

statswalesr 1.0.0

CRAN release: 2026-07-12

  • Migrated to StatsWales API v2 (https://api.stats.gov.wales/v2)
  • Added a sort_by argument to statswales_get_dataset(), statswales_get_pivot(), and statswales_get_topic(). Accepts either a "column:direction" string or a named vector like c(Year = "desc")
  • statswales_get_filters() now flattens hierarchical dimensions: the values data frame gains parent and level columns 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 new list(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; supports mode argument (basic, fts, fuzzy, etc.)
  • statswales_get_filters() path updated to /{id}/filters
  • statswales_download_dataset() now uses the POST + GET filter ID flow; format is 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 *_sort columns are dropped, whitespace padding is stripped, and numeric-looking columns (including data values) are converted to numeric. Set tidy = FALSE for the raw API response
  • statswales_get_dataset() now returns the entire dataset by default (all_pages = TRUE); set all_pages = FALSE for single-page retrieval. The default page_size was 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; the page_number and page_size arguments were removed
  • Timestamp columns from statswales_list_datasets() and statswales_search() are now POSIXct (UTC) instead of character
  • All API requests now retry transient failures (up to 3 attempts)

statswalesr 0.4.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

statswalesr 0.1.3

CRAN release: 2021-05-12

  • added better error handling when API does not respond

statswalesr 0.1.2

CRAN release: 2021-01-23

  • added more robust http error handling to statswales_get_metadata()

statswalesr 0.1.1

CRAN release: 2020-11-29

  • added more helpful error messages for http errors

statswalesr 0.1.0

CRAN release: 2020-11-26

  • fixed a bug that exported the pipe operator %>% with the package