Learn R Programming

openairmaps (version 0.9.0)

convertPostcode: Convert a UK postcode to a latitude/longitude pair

Description

This is a much simpler implementation of the tools found in the PostcodesioR R package, intended for use with the searchNetwork() function.

Usage

convertPostcode(postcode)

Value

A list containing the latitude, longitude, and input postcode.

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

Run this code
# convert a UK postcode
convertPostcode("SW1A1AA")

if (FALSE) {
# use with `searchNetwork()`
palace <- convertPostcode("SW1A1AA")
searchNetwork(lat = palace$lat, lng = palace$lng, max_dist = 10)
}

Run the code above in your browser using DataLab