strmatch {cwhmisc}R Documentation

A "shortest unique identifier" match.

Description

If an input string matches no output string, return NA.

If it is an ambiguous match, return 0.

Otherwise return the index of the match.

Exception: if the target string contains "log" and "logistic", and the user type "lo" it is ambiguous, but if he types "log" consider it a perfect match.

Usage

strmatch(inputs, target)

Arguments

inputs The string to be found as a match.
target The string which should contain the match.

Value

The matched string, if it exists. NA, if input matches no output string. 0 , if ambiguous matches are found.

Note

Uses .C("strmatch", which is Not Found in R ??!

Author(s)

? from SCCS: \@(\#)strmatch.s 2.2 1989-09-27

Examples

# strmatch(c("he","we"), c("She will","in awe","xxxx"))

[Package cwhmisc version 2.0.1 Index]