Returns a random postcode and all available data for that postcode.

random_postcode(outcode = NULL)

Arguments

outcode

A string. Filters random postcodes by outcode. Returns null if invalid outcode. Optional.

Value

A list with a random postcode with corresponding characteristics.

See also

postcode_lookup for documentation.

Examples

# \donttest{ random_postcode()
#> $postcode #> [1] "LS26 8LX" #> #> $quality #> [1] 1 #> #> $eastings #> [1] 436649 #> #> $northings #> [1] 428807 #> #> $country #> [1] "England" #> #> $nhs_ha #> [1] "Yorkshire and the Humber" #> #> $longitude #> [1] -1.445657 #> #> $latitude #> [1] 53.75435 #> #> $european_electoral_region #> [1] "Yorkshire and The Humber" #> #> $primary_care_trust #> [1] "Leeds" #> #> $region #> [1] "Yorkshire and The Humber" #> #> $lsoa #> [1] "Leeds 097C" #> #> $msoa #> [1] "Leeds 097" #> #> $incode #> [1] "8LX" #> #> $outcode #> [1] "LS26" #> #> $parliamentary_constituency #> [1] "Elmet and Rothwell" #> #> $admin_district #> [1] "Leeds" #> #> $parish #> [1] "Leeds, unparished area" #> #> $admin_county #> NULL #> #> $admin_ward #> [1] "Rothwell" #> #> $ced #> NULL #> #> $ccg #> [1] "NHS Leeds" #> #> $nuts #> [1] "Leeds" #> #> $codes #> $codes$admin_district #> [1] "E08000035" #> #> $codes$admin_county #> [1] "E99999999" #> #> $codes$admin_ward #> [1] "E05011410" #> #> $codes$parish #> [1] "E43000276" #> #> $codes$parliamentary_constituency #> [1] "E14000689" #> #> $codes$ccg #> [1] "E38000225" #> #> $codes$ccg_id #> [1] "15F" #> #> $codes$ced #> [1] "E99999999" #> #> $codes$nuts #> [1] "TLE42" #> #> $codes$lsoa #> [1] "E01011637" #> #> $codes$msoa #> [1] "E02002426" #> #> $codes$lau2 #> [1] "E08000035" #> #>
random_postcode("N1")
#> $postcode #> [1] "N1 7JB" #> #> $quality #> [1] 1 #> #> $eastings #> [1] 532499 #> #> $northings #> [1] 183392 #> #> $country #> [1] "England" #> #> $nhs_ha #> [1] "London" #> #> $longitude #> [1] -0.091096 #> #> $latitude #> [1] 51.53389 #> #> $european_electoral_region #> [1] "London" #> #> $primary_care_trust #> [1] "City and Hackney Teaching" #> #> $region #> [1] "London" #> #> $lsoa #> [1] "Hackney 026C" #> #> $msoa #> [1] "Hackney 026" #> #> $incode #> [1] "7JB" #> #> $outcode #> [1] "N1" #> #> $parliamentary_constituency #> [1] "Hackney South and Shoreditch" #> #> $admin_district #> [1] "Hackney" #> #> $parish #> [1] "Hackney, unparished area" #> #> $admin_county #> NULL #> #> $admin_ward #> [1] "Hoxton West" #> #> $ced #> NULL #> #> $ccg #> [1] "NHS North East London" #> #> $nuts #> [1] "Hackney and Newham" #> #> $codes #> $codes$admin_district #> [1] "E09000012" #> #> $codes$admin_county #> [1] "E99999999" #> #> $codes$admin_ward #> [1] "E05009378" #> #> $codes$parish #> [1] "E43000202" #> #> $codes$parliamentary_constituency #> [1] "E14000721" #> #> $codes$ccg #> [1] "E38000255" #> #> $codes$ccg_id #> [1] "A3A8R" #> #> $codes$ced #> [1] "E99999999" #> #> $codes$nuts #> [1] "TLI41" #> #> $codes$lsoa #> [1] "E01001782" #> #> $codes$msoa #> [1] "E02000370" #> #> $codes$lau2 #> [1] "E09000012" #> #>
# }