Returns a random postcode and all available data for that postcode.
See also
postcode_lookup for documentation.
Examples
# \donttest{
random_postcode()
#> $postcode
#> [1] "BA2 7QY"
#>
#> $quality
#> [1] 1
#>
#> $eastings
#> [1] 377816
#>
#> $northings
#> [1] 153109
#>
#> $country
#> [1] "England"
#>
#> $nhs_ha
#> [1] "South West"
#>
#> $longitude
#> [1] -2.319416
#>
#> $latitude
#> [1] 51.27669
#>
#> $european_electoral_region
#> [1] "South West"
#>
#> $primary_care_trust
#> [1] "Somerset"
#>
#> $region
#> [1] "South West"
#>
#> $lsoa
#> [1] "Mendip 001E"
#>
#> $msoa
#> [1] "Mendip 001"
#>
#> $incode
#> [1] "7QY"
#>
#> $outcode
#> [1] "BA2"
#>
#> $parliamentary_constituency
#> [1] "Frome and East Somerset"
#>
#> $parliamentary_constituency_2024
#> [1] "Frome and East Somerset"
#>
#> $senedd_constituency
#> NULL
#>
#> $senedd_constituency_no
#> NULL
#>
#> $admin_district
#> [1] "Somerset"
#>
#> $parish
#> [1] "Lullington"
#>
#> $admin_county
#> NULL
#>
#> $date_of_introduction
#> [1] "200106"
#>
#> $date_of_termination
#> NULL
#>
#> $index_of_multiple_deprivation
#> [1] 18875
#>
#> $admin_ward
#> [1] "Frome North"
#>
#> $ced
#> NULL
#>
#> $ccg
#> [1] "NHS Somerset"
#>
#> $nuts
#> [1] "Somerset"
#>
#> $pfa
#> [1] "Avon and Somerset"
#>
#> $nhs_region
#> [1] "South West"
#>
#> $ttwa
#> [1] "Bath"
#>
#> $national_park
#> [1] "England (non-National Park)"
#>
#> $bua
#> NULL
#>
#> $icb
#> [1] "NHS Somerset Integrated Care Board"
#>
#> $cancer_alliance
#> [1] "Somerset, Wiltshire, Avon and Gloucestershire"
#>
#> $lsoa11
#> [1] "Mendip 001E"
#>
#> $msoa11
#> [1] "Mendip 001"
#>
#> $lsoa21
#> [1] "Mendip 001E"
#>
#> $msoa21
#> [1] "Mendip 001"
#>
#> $oa21
#> [1] "E00147984"
#>
#> $ruc11
#> [1] "(England/Wales) Rural hamlet and isolated dwellings"
#>
#> $ruc21
#> [1] "Smaller rural: Nearer to a major town or city"
#>
#> $lep1
#> [1] "Heart of the South West"
#>
#> $lep2
#> NULL
#>
#> $codes
#> $codes$admin_district
#> [1] "E06000066"
#>
#> $codes$admin_county
#> [1] "E99999999"
#>
#> $codes$admin_ward
#> [1] "E05014361"
#>
#> $codes$parish
#> [1] "E04008569"
#>
#> $codes$parliamentary_constituency
#> [1] "E14001241"
#>
#> $codes$parliamentary_constituency_2024
#> [1] "E14001241"
#>
#> $codes$ccg
#> [1] "E38000150"
#>
#> $codes$ccg_id
#> [1] "11X"
#>
#> $codes$ced
#> [1] "E99999999"
#>
#> $codes$nuts
#> [1] "TLK62"
#>
#> $codes$lsoa
#> [1] "E01029057"
#>
#> $codes$msoa
#> [1] "E02006047"
#>
#> $codes$lau2
#> [1] "E06000066"
#>
#> $codes$pfa
#> [1] "E23000036"
#>
#> $codes$nhs_region
#> [1] "E40000006"
#>
#> $codes$ttwa
#> [1] "E30000165"
#>
#> $codes$national_park
#> [1] "E65000001"
#>
#> $codes$bua
#> NULL
#>
#> $codes$icb
#> [1] "E54000038"
#>
#> $codes$cancer_alliance
#> [1] "E56000033"
#>
#> $codes$lsoa11
#> [1] "E01029057"
#>
#> $codes$msoa11
#> [1] "E02006047"
#>
#> $codes$lsoa21
#> [1] "E01029057"
#>
#> $codes$msoa21
#> [1] "E02006047"
#>
#> $codes$oa21
#> [1] "E00147984"
#>
#> $codes$ruc11
#> [1] "F1"
#>
#> $codes$ruc21
#> [1] "RSN1"
#>
#> $codes$lep1
#> [1] "E37000016"
#>
#> $codes$lep2
#> NULL
#>
#>
random_postcode("N1")
#> $postcode
#> [1] "N1 7EX"
#>
#> $quality
#> [1] 1
#>
#> $eastings
#> [1] 532478
#>
#> $northings
#> [1] 183153
#>
#> $country
#> [1] "England"
#>
#> $nhs_ha
#> [1] "London"
#>
#> $longitude
#> [1] -0.091462
#>
#> $latitude
#> [1] 51.53175
#>
#> $european_electoral_region
#> [1] "London"
#>
#> $primary_care_trust
#> [1] "City and Hackney Teaching"
#>
#> $region
#> [1] "London"
#>
#> $lsoa
#> [1] "Hackney 026G"
#>
#> $msoa
#> [1] "Hackney 026"
#>
#> $incode
#> [1] "7EX"
#>
#> $outcode
#> [1] "N1"
#>
#> $parliamentary_constituency
#> [1] "Hackney South and Shoreditch"
#>
#> $parliamentary_constituency_2024
#> [1] "Hackney South and Shoreditch"
#>
#> $senedd_constituency
#> NULL
#>
#> $senedd_constituency_no
#> NULL
#>
#> $admin_district
#> [1] "Hackney"
#>
#> $parish
#> [1] "Hackney, unparished area"
#>
#> $admin_county
#> NULL
#>
#> $date_of_introduction
#> [1] "200906"
#>
#> $date_of_termination
#> NULL
#>
#> $index_of_multiple_deprivation
#> [1] 7718
#>
#> $admin_ward
#> [1] "Hoxton West"
#>
#> $ced
#> NULL
#>
#> $ccg
#> [1] "NHS North East London"
#>
#> $nuts
#> [1] "Hackney"
#>
#> $pfa
#> [1] "Metropolitan Police"
#>
#> $nhs_region
#> [1] "London"
#>
#> $ttwa
#> [1] "London"
#>
#> $national_park
#> [1] "England (non-National Park)"
#>
#> $bua
#> [1] "Hackney"
#>
#> $icb
#> [1] "NHS North East London Integrated Care Board"
#>
#> $cancer_alliance
#> [1] "North East London"
#>
#> $lsoa11
#> [1] "Hackney 026A"
#>
#> $msoa11
#> [1] "Hackney 026"
#>
#> $lsoa21
#> [1] "Hackney 026G"
#>
#> $msoa21
#> [1] "Hackney 026"
#>
#> $oa21
#> [1] "E00183879"
#>
#> $ruc11
#> [1] "(England/Wales) Urban major conurbation"
#>
#> $ruc21
#> [1] "Urban: Nearer to a major town or city"
#>
#> $lep1
#> [1] "London"
#>
#> $lep2
#> NULL
#>
#> $codes
#> $codes$admin_district
#> [1] "E09000012"
#>
#> $codes$admin_county
#> [1] "E99999999"
#>
#> $codes$admin_ward
#> [1] "E05009378"
#>
#> $codes$parish
#> [1] "E43000202"
#>
#> $codes$parliamentary_constituency
#> [1] "E14001260"
#>
#> $codes$parliamentary_constituency_2024
#> [1] "E14001260"
#>
#> $codes$ccg
#> [1] "E38000255"
#>
#> $codes$ccg_id
#> [1] "A3A8R"
#>
#> $codes$ced
#> [1] "E99999999"
#>
#> $codes$nuts
#> [1] "TLI41"
#>
#> $codes$lsoa
#> [1] "E01035648"
#>
#> $codes$msoa
#> [1] "E02000370"
#>
#> $codes$lau2
#> [1] "E09000012"
#>
#> $codes$pfa
#> [1] "E23000001"
#>
#> $codes$nhs_region
#> [1] "E40000003"
#>
#> $codes$ttwa
#> [1] "E30000234"
#>
#> $codes$national_park
#> [1] "E65000001"
#>
#> $codes$bua
#> [1] "E63011969"
#>
#> $codes$icb
#> [1] "E54000029"
#>
#> $codes$cancer_alliance
#> [1] "E56000028"
#>
#> $codes$lsoa11
#> [1] "E01001779"
#>
#> $codes$msoa11
#> [1] "E02000370"
#>
#> $codes$lsoa21
#> [1] "E01035648"
#>
#> $codes$msoa21
#> [1] "E02000370"
#>
#> $codes$oa21
#> [1] "E00183879"
#>
#> $codes$ruc11
#> [1] "A1"
#>
#> $codes$ruc21
#> [1] "UN1"
#>
#> $codes$lep1
#> [1] "E37000051"
#>
#> $codes$lep2
#> NULL
#>
#>
# }
