fetch_postcodes: Fetch entire postcodes

View source: R/fetch_postcode.R

fetch_postcodesR Documentation

Fetch entire postcodes

Description

Fetch entire postcodes

Usage

fetch_postcodes(postcodes)

Arguments

postcodes

one or more postcodes (as numbers, which will be coerced to integers)

Details

Returns an entire postcode of address data. This is useful for generating samples on a per-postcode basis.

Value

data.table containing all addresses and coordinates

Examples

load(system.file("extdata", "bne_addresses.rda", package = "PSMA"))

bnedata <- fetch_postcodes(unique(bne_addresses$postcode))
# Select 3 addresses at random from each postcode
bnedata[, .SD[sample(.N, 3)], by=.(POSTCODE)]


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