This is a much simpler implementation of the tools found in the
PostcodesioR
R package, intended for use with the searchNetwork()
function.
Arguments
- postcode
A valid UK postcode.
required
A string containing a single valid UK postcode, e.g.,
"SW1A 1AA"
.
See also
The PostcodesioR
package at
https://github.com/ropensci/PostcodesioR/
Examples
# convert a UK postcode
convertPostcode("SW1A1AA")
#> $lat
#> [1] 51.50101
#>
#> $lng
#> [1] -0.141588
#>
#> $postcode
#> [1] "SW1A 1AA"
#>
if (FALSE) {
# use with `searchNetwork()`
palace <- convertPostcode("SW1A1AA")
searchNetwork(lat = palace$lat, lng = palace$lng, max_dist = 10)
}