Returns a random postcode and all available data for that postcode.
See also
postcode_lookup
for documentation.
Examples
# \donttest{
random_postcode()
#> $postcode
#> [1] "GU46 7SP"
#>
#> $quality
#> [1] 1
#>
#> $eastings
#> [1] 481304
#>
#> $northings
#> [1] 161306
#>
#> $country
#> [1] "England"
#>
#> $nhs_ha
#> [1] "South Central"
#>
#> $longitude
#> [1] -0.834045
#>
#> $latitude
#> [1] 51.34503
#>
#> $european_electoral_region
#> [1] "South East"
#>
#> $primary_care_trust
#> [1] "Hampshire"
#>
#> $region
#> [1] "South East"
#>
#> $lsoa
#> [1] "Hart 001D"
#>
#> $msoa
#> [1] "Hart 001"
#>
#> $incode
#> [1] "7SP"
#>
#> $outcode
#> [1] "GU46"
#>
#> $parliamentary_constituency
#> [1] "North East Hampshire"
#>
#> $parliamentary_constituency_2024
#> [1] "North East Hampshire"
#>
#> $admin_district
#> [1] "Hart"
#>
#> $parish
#> [1] "Yateley"
#>
#> $admin_county
#> [1] "Hampshire"
#>
#> $date_of_introduction
#> [1] "199606"
#>
#> $admin_ward
#> [1] "Yateley West"
#>
#> $ced
#> [1] "Hartley Wintney & Yateley West"
#>
#> $ccg
#> [1] "NHS Frimley"
#>
#> $nuts
#> [1] "Hart"
#>
#> $pfa
#> [1] "Hampshire"
#>
#> $codes
#> $codes$admin_district
#> [1] "E07000089"
#>
#> $codes$admin_county
#> [1] "E10000014"
#>
#> $codes$admin_ward
#> [1] "E05009362"
#>
#> $codes$parish
#> [1] "E04004553"
#>
#> $codes$parliamentary_constituency
#> [1] "E14001392"
#>
#> $codes$parliamentary_constituency_2024
#> [1] "E14001392"
#>
#> $codes$ccg
#> [1] "E38000252"
#>
#> $codes$ccg_id
#> [1] "D4U1Y"
#>
#> $codes$ced
#> [1] "E58000565"
#>
#> $codes$nuts
#> [1] "TLJ37"
#>
#> $codes$lsoa
#> [1] "E01022893"
#>
#> $codes$msoa
#> [1] "E02004751"
#>
#> $codes$lau2
#> [1] "E07000089"
#>
#> $codes$pfa
#> [1] "E23000030"
#>
#>
random_postcode("N1")
#> $postcode
#> [1] "N1 1XL"
#>
#> $quality
#> [1] 1
#>
#> $eastings
#> [1] 531630
#>
#> $northings
#> [1] 183943
#>
#> $country
#> [1] "England"
#>
#> $nhs_ha
#> [1] "London"
#>
#> $longitude
#> [1] -0.103385
#>
#> $latitude
#> [1] 51.53905
#>
#> $european_electoral_region
#> [1] "London"
#>
#> $primary_care_trust
#> [1] "Islington"
#>
#> $region
#> [1] "London"
#>
#> $lsoa
#> [1] "Islington 020B"
#>
#> $msoa
#> [1] "Islington 020"
#>
#> $incode
#> [1] "1XL"
#>
#> $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] "200704"
#>
#> $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] "E01002794"
#>
#> $codes$msoa
#> [1] "E02000573"
#>
#> $codes$lau2
#> [1] "E09000019"
#>
#> $codes$pfa
#> [1] "E23000001"
#>
#>
# }