geocode: Geocode address

View source: R/geocode.R

geocodeR Documentation

Geocode address

Description

Geocode address

Usage

geocode(
  flat_number = NULL,
  number_first = NULL,
  building_name = NULL,
  street_name = NULL,
  street_type = NULL,
  postcode,
  attempt_decode_street_abbrev = FALSE,
  approx = 0L
)

Arguments

flat_number, number_first, street_name, street_type, postcode

The address to be geocoded. Argument postcode is mandatory.

building_name

If street_name is not provided, searches for building names in that postcode

attempt_decode_street_abbrev

Should abbreviated street types be decoded during the geocoding attempt?

approx

integer(1) If 0, only exact matches are made. If 1L, interpolation is allowed. Other values may be allowed

Value

A data.table of three columns and the same number of rows as the longest argument.

Examples

geocode(flat_number = NA_character_,
        number_first = 8L,
        street_name = "MALVINA",
        street_type = "PLACE",
        postcode = 3053L)

load(system.file("extdata", "bne_addresses.rda", package = "PSMA"))
with(bne_addresses,
    geocode(flat_number = NA_character_,
            number_first = house_number,
            street_name = street_name,
            street_type = street_type,
            postcode = postcode))


HughParsonage/PSMA documentation built on May 21, 2022, 10:16 p.m.