Learn R Programming

campfin (version 1.0.11)

is_abbrev: Check if abbreviation

Description

To return a value of TRUE, (1) the first letter of abb must match the first letter of full, (2) all letters of abb must exist in full, and (3) those letters of abb must be in the same order as they appear in full.

Usage

is_abbrev(abb, full)

Value

logical; whether abb is potential abbreviation of full

Arguments

abb

A suspected abbreviation

full

A long form string to test against

Examples

Run this code
is_abbrev(abb = "BRX", full = "BRONX")
is_abbrev(abb = state.abb, full = state.name)
is_abbrev(abb = "NOLA", full = "New Orleans")
is_abbrev(abb = "FE", full = "Iron")

Run the code above in your browser using DataLab