Skip to contents

readaec (development version)

  • Downloads now time out instead of hanging. httr2 sets no transfer timeout, so an AEC server that accepted the connection and then stalled would hang the R session indefinitely (and on CRAN, the whole check). Requests now abort after 20 seconds without a connection, or 60 seconds of a stalled transfer, and the failure is reported with the file name and URL. Slow but progressing downloads still finish.

  • The download cache now expires. Cached files were reused forever, so a user who first downloaded a file while the AEC was still counting, or before the AEC revised it, kept the stale copy until they called clear_cache() or passed refresh = TRUE. Files older than 30 days are now downloaded again; set options(readaec.cache_ttl = ) in hours to change this.

readaec 0.2.0

CRAN release: 2026-08-02

New data

Improvements and fixes

  • get_swing() now reports the party that actually won each seat (winner_from, winner_to), joined from the AEC members elected file. Previously winners were inferred from TPP shares, which misidentified seats won by independents and minor parties. The TPP-based columns are retained as tpp_leader_from and tpp_leader_to.
  • All data functions gain a refresh argument to force a re-download, useful on election night when cached counts go stale.
  • HTTP failures now produce a readable error with the status code. Previously the status check was unreachable because ‘httr2’ errors on non-200 responses before the check ran.
  • Downloads are written to a temporary file and only moved into the cache once complete, so an interrupted download can no longer leave a corrupt file that is served from cache indefinitely.
  • Requests now identify the package via a user agent and retry up to three times on transient failures.
  • Column types are now guessed from the whole file rather than the first 1000 rows, fixing parsing warnings on get_polling_places().

readaec 0.1.3 (not released)

  • Added HTTP status validation to get_fp_by_booth() for consistency with other data functions.

readaec 0.1.2

CRAN release: 2026-03-16

  • Examples now cache to tempdir() instead of the user’s home directory, fixing CRAN policy compliance for \donttest examples.
  • Cache directory is now configurable via options(readaec.cache_dir = ...).
  • Replaced rappdirs dependency with tools::R_user_dir() (base R).

readaec 0.1.1

CRAN release: 2026-03-10

  • Added AEC web service URL to DESCRIPTION per CRAN policy
  • Added \value documentation to clear_cache()
  • Changed \dontrun{} to \donttest{} in all examples that require a network connection

readaec 0.1.0