Skip to contents

Templates, code formatting and system set-up

Tools for establishing relevant user settings

air_install()
Air Install
air_style()
Air - style code in scripts
create_project()
Creates a pre-populated project for DfE R

Standard DfE data sets

Data sets exported in the package

ons_geog_shorthands
Lookup for ONS geography columns shorthands
geo_hierarchy
Geography hierarchy lookup
countries
Lookup for valid country names and codes
regions
Lookup for valid region names and codes
geog_time_identifiers
Potential names for geography and time columns
wd_pcon_lad_la_rgn_ctry deprecated
Ward to Constituency to LAD to LA to Region to Country lookup
lsip_lad
Local Skills Improvement Plan (LSIP) areas to Local Authority District (LAD) Lookup

Fetch geography lists

Pull geography lookups and reference data from the ONS Geography Portal and other trusted sources

fetch_pcons()
Fetch Westminster parliamentary constituencies
fetch_countries()
Fetch countries
fetch_lads()
Fetch local authority districts
fetch_las()
Fetch local authorities
fetch_lsips()
Fetch Local Skills Improvement Plan (LSIP) areas lookup
fetch_mayoral()
Fetch mayoral combined authorities
fetch_mp_lookup()
Fetch Westminster constituency to MP lookup
fetch_regions()
Fetch regions
fetch_wards()
Fetch wards
get_ons_api_data()
Fetch ONS Open Geography API data

Database connection

Helpful functions for connecting to databases in DfE

get_clean_sql()
Get a cleaned SQL script into R
check_databricks_odbc()
Check Databricks ODBC connection variables
write_df_to_delta()
Write a Data Frame to Delta Lake with COPY INTO

Presentation prettifiers

Functions for presenting pretty versions of numbers with readable code

pretty_filesize()
Pretty numbers into readable file size
pretty_num()
Prettify big numbers into a readable format
pretty_num_table()
Format a data frame with dfeR::pretty_num().
pretty_time()
Pretty time
pretty_time_taken()
Calculate elapsed time between two points and present prettily
round_five_up()
Round five up
comma_sep()
Comma separate
z_replace()
Replaces NA values in tables

Specific formats

Functions for converting to specific formats

format_ay()
Format academic year
format_ay_reverse()
Undo academic year formatting
format_fy()
Format financial year
format_fy_reverse()
Undo financial year formatting

System diagnostics

Functions to diagnose and fix common system issues

diagnostic_test()
Diagnostic testing
check_proxy_settings()
Check proxy settings
check_git_sslverify()
Check Git sslverify setting
check_gitconfig_location()
Check the location of the global .gitconfig file
check_github_pat()
Check GITHUB_PAT setting
check_renv_download_method()
Check renv download method
check_renv_dl_file_method()
Check RENV_DOWNLOAD_FILE_METHOD system variable
check_rtools()
Check for an RTools / make toolchain
check_renv_rprof_location()
Check the location of .Renviron and .Rprofile

Helpers

Functions used in other functions across the package, exported as they can also be useful in their own right

toggle_message()
Controllable console messages