Returns a random postcode and all available data for that postcode.
See also
postcode_lookup
for documentation.
Examples
# \donttest{
random_postcode()
#> $postcode
#> [1] "SN14 6RX"
#>
#> $quality
#> [1] 1
#>
#> $eastings
#> [1] 383541
#>
#> $northings
#> [1] 183770
#>
#> $country
#> [1] "England"
#>
#> $nhs_ha
#> [1] "South West"
#>
#> $longitude
#> [1] -2.238774
#>
#> $latitude
#> [1] 51.55257
#>
#> $european_electoral_region
#> [1] "South West"
#>
#> $primary_care_trust
#> [1] "Wiltshire"
#>
#> $region
#> [1] "South West"
#>
#> $lsoa
#> [1] "Wiltshire 005A"
#>
#> $msoa
#> [1] "Wiltshire 005"
#>
#> $incode
#> [1] "6RX"
#>
#> $outcode
#> [1] "SN14"
#>
#> $parliamentary_constituency
#> [1] "South Cotswolds"
#>
#> $parliamentary_constituency_2024
#> [1] "South Cotswolds"
#>
#> $admin_district
#> [1] "Wiltshire"
#>
#> $parish
#> [1] "Luckington"
#>
#> $admin_county
#> NULL
#>
#> $date_of_introduction
#> [1] "199906"
#>
#> $admin_ward
#> [1] "Sherston"
#>
#> $ced
#> NULL
#>
#> $ccg
#> [1] "NHS Bath and North East Somerset, Swindon and Wiltshire"
#>
#> $nuts
#> [1] "Wiltshire"
#>
#> $pfa
#> [1] "Wiltshire"
#>
#> $codes
#> $codes$admin_district
#> [1] "E06000054"
#>
#> $codes$admin_county
#> [1] "E99999999"
#>
#> $codes$admin_ward
#> [1] "E05013470"
#>
#> $codes$parish
#> [1] "E04011759"
#>
#> $codes$parliamentary_constituency
#> [1] "E14001482"
#>
#> $codes$parliamentary_constituency_2024
#> [1] "E14001482"
#>
#> $codes$ccg
#> [1] "E38000231"
#>
#> $codes$ccg_id
#> [1] "92G"
#>
#> $codes$ced
#> [1] "E99999999"
#>
#> $codes$nuts
#> [1] "TLK72"
#>
#> $codes$lsoa
#> [1] "E01031957"
#>
#> $codes$msoa
#> [1] "E02006648"
#>
#> $codes$lau2
#> [1] "E06000054"
#>
#> $codes$pfa
#> [1] "E23000038"
#>
#>
random_postcode("N1")
#> $postcode
#> [1] "N1 7AN"
#>
#> $quality
#> [1] 1
#>
#> $eastings
#> [1] 532437
#>
#> $northings
#> [1] 183723
#>
#> $country
#> [1] "England"
#>
#> $nhs_ha
#> [1] "London"
#>
#> $longitude
#> [1] -0.091838
#>
#> $latitude
#> [1] 51.53688
#>
#> $european_electoral_region
#> [1] "London"
#>
#> $primary_care_trust
#> [1] "Islington"
#>
#> $region
#> [1] "London"
#>
#> $lsoa
#> [1] "Islington 018C"
#>
#> $msoa
#> [1] "Islington 018"
#>
#> $incode
#> [1] "7AN"
#>
#> $outcode
#> [1] "N1"
#>
#> $parliamentary_constituency
#> [1] "Islington South and Finsbury"
#>
#> $parliamentary_constituency_2024
#> [1] "Islington South and Finsbury"
#>
#> $admin_district
#> [1] "Islington"
#>
#> $parish
#> [1] "Islington, unparished area"
#>
#> $admin_county
#> NULL
#>
#> $date_of_introduction
#> [1] "198001"
#>
#> $admin_ward
#> [1] "St Mary's & St James'"
#>
#> $ced
#> NULL
#>
#> $ccg
#> [1] "NHS North Central London"
#>
#> $nuts
#> [1] "Islington"
#>
#> $pfa
#> [1] "Metropolitan Police"
#>
#> $codes
#> $codes$admin_district
#> [1] "E09000019"
#>
#> $codes$admin_county
#> [1] "E99999999"
#>
#> $codes$admin_ward
#> [1] "E05013710"
#>
#> $codes$parish
#> [1] "E43000209"
#>
#> $codes$parliamentary_constituency
#> [1] "E14001306"
#>
#> $codes$parliamentary_constituency_2024
#> [1] "E14001306"
#>
#> $codes$ccg
#> [1] "E38000240"
#>
#> $codes$ccg_id
#> [1] "93C"
#>
#> $codes$ced
#> [1] "E99999999"
#>
#> $codes$nuts
#> [1] "TLI43"
#>
#> $codes$lsoa
#> [1] "E01002798"
#>
#> $codes$msoa
#> [1] "E02000571"
#>
#> $codes$lau2
#> [1] "E09000019"
#>
#> $codes$pfa
#> [1] "E23000001"
#>
#>
# }