dfeR 2.0.0
CRAN release: 2026-09-23
-
Breaking change: Removed the deprecated
wd_pcon_lad_la_rgn_ctrydataset and its startup message. Usegeo_hierarchyinstead, which has all the same columns plus more, and is kept up to date (it includes 2025,wd_pcon_lad_la_rgn_ctrystopped at 2024). - Added
diagnostic_test()and a set ofcheck_*helpers to diagnose and (optionally) fix common DfE laptop R-setup issues — proxy settings, Git SSL verification,GITHUB_PAT, renv download methods, RTools toolchain, global.gitconfiglocation, and.Renviron/.Rprofilelocation. - Added
fetch_mp_lookup()to fetch the Westminster constituency to sitting MP lookup maintained at https://github.com/dfe-analytical-services/mp-lookup, giving one row per constituency with the MP’s name, party, member ID and email alongside the geography the constituency maps to. It errors with an informative message if the upstream file is missing any expected columns. -
air_install()now checks the installed Air version and automatically reinstalls it if it is older than the minimum version required byair_style()(currently 0.10.0, when Air’s defaultassignment-stylechanged to"arrow"). It also gains aforceargument to always reinstall. If the install does not leave a supported version of Air in place, it now warns rather than failing silently. -
format_ay(),format_fy(),format_ay_reverse()andformat_fy_reverse()now accept vectors of years, e.g.format_ay(c(201617, 201718)). Previously they failed given more than one value. - Fixed
get_ons_api_data()ignoring anywherefilter inquery_params; filtered queries could return extra rows. It also now gives informative errors when a query matches nothing, the API can’t be reached, or the API rejects the request (for example an unknowndata_id). - Fixed
air_style()failing when thetargetpath contains spaces (for example a OneDrive path under “OneDrive - Department for Education”). - Fixed
check_databricks_odbc()failing for users who don’t havestringrinstalled.
dfeR 1.3.0
-
Breaking change: In
geo_hierarchyand the output offetch_mayoral(), thecauth_nameandcauth_codecolumns are renamed toenglish_devolved_area_nameandenglish_devolved_area_code, and the Greater London Authority is now included as the mayoral authority for London boroughs. - Added
air_install()andair_style()to install and run the Air formatter on R code. - Added
write_df_to_delta()to write a data frame to a Delta table in Databricks, with an accompanying vignette. It acceptsDATABRICKS_HOSTwith or without a scheme; bare hosts havehttps://prepended automatically,http://is upgraded tohttps://, and any trailing slash is stripped. An unset or emptyDATABRICKS_HOSTgives a clear error. - Added the data
lsip_ladwhich is a lookup table for Local Skills Improvement Plan (LSIP) areas and the functionfetch_lsips()to fetch LSIP data. - Updated
geo_hierarchy, and associatedfetch_*functions with latest 2025 lookups. - Updated
pretty_num()to add anabbreviateargument giving the option to avoid displaying large numbers in millions/billions, and adynamic_dp_valueargument that adds decimal places only when a value in millions/billions isn’t a whole number. - The
fetch_*()functions now give an error when given a year that their lookup does not cover, where previously they returned an empty data frame.
dfeR 1.2.0
- Added
geo_hierarchy, which supersedeswd_pcon_lad_la_rgn_ctryand adds 2025 along with mayoral columns. - Added
fetch_mayoral().
dfeR 1.1.0
- Added a function that checks Databricks variables for ODBC connections:
check_databricks_odbc(). - Updated
wd_pcon_lad_la_rgn_ctryby adding three digit local authority codes (also known as old_la_codes) to the data. - Added old_la_codes which is an internal lookup table of local authorities with their names, nine digit codes and ‘old’ three digit codes. It is used to add ‘old’ 3 digit la codes to
wd_pcon_lad_la_rgn_ctry. - Updated
fetch_las()so that old_la_codes are included in the output.
dfeR 1.0.1
CRAN release: 2025-01-15
Fix the spacing and printing of the z_replace() warning message, updating the eesyapi URL in the README and removed extraneous package tests.
dfeR 1.0.0
CRAN release: 2025-01-13
Initial CRAN release. Added lookup data geog_time_identifiers. Added z_replace() to replace NA values in tables except for ones in geography and time columns that match ones in geog_time_identifiers.
dfeR 0.6.0
Update pretty_num so that:
- it can take single or multiple values.
- it has the argument
nsmallthat allows control over the number of digits displayed after rounding.
Add pretty_num_table() which uses pretty_num() to format numbers in a readable format in data frames. It has all the customization provided by pretty_num.
dfeR 0.5.0
Add the following lookup data sets into the package:
- ons_geog_shorthands
- countries
- regions
- wd_pcon_lad_la_rgn_ctry
Add the following fetch_locations() functions:
- fetch_wards()
- fetch_pcons()
- fetch_lads()
- fetch_las()
- fetch_regions()
- fetch_countries()
Add wrapper for ONS Open Geography Portal API:
- get_ons_api_data()
Add helper for turning messages on or off:
- toggle_message()
dfeR 0.4.1
Update comma_sep() function to allow non-numeric values instead of throwing an error, now returns them unchanged.
dfeR 0.3.1
Fix bug in get_clean_sql() where using the additional settings would lose the original SQL statement.
dfeR 0.3.0
Add pretty_* functions for presenting pretty numbers:
- pretty_num()
- pretty_filesize()
- pretty_time_taken()
Add helper function for comma separating numbers:
- comma_sep()
