Learn R Programming

healthyAddress (version 0.4.5)

extract_postcode: Extract the postcode from the suffix of a string

Description

Extract the postcode from the suffix of a string

Usage

extract_postcode(x)

Value

An integer vector the same length as x, giving the postcode as it appears in the last 3 or 4 characters in each string. Returns NA_integer_ for other strings.

There is no guarantee made that the postcode is a real postcode.

Arguments

x

A character vector.

Examples

Run this code
extract_postcode("3000")
extract_postcode("Melbourne Vic 3000")

Run the code above in your browser using DataLab