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

View source: R/utilities.R

convertPostcodeR Documentation

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)

Arguments

postcode

A valid UK postcode.

required

A string containing a single valid UK postcode, e.g., "SW1A 1AA".

Value

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

Source

https://postcodes.io/

See Also

The PostcodesioR package at https://github.com/ropensci/PostcodesioR/

Examples

# convert a UK postcode
convertPostcode("SW1A1AA")

## Not run: 
# use with `searchNetwork()`
palace <- convertPostcode("SW1A1AA")
searchNetwork(lat = palace$lat, lng = palace$lng, max_dist = 10)

## End(Not run)


davidcarslaw/openairmaps documentation built on April 28, 2024, 3 p.m.