abbreviation: Allows Abbreviations of Character Data

Description Usage Arguments Details Value Author(s) Examples

View source: R/abbreviation.R

Description

Determines if one character variable is an abbreviation among a section of other character variables.

Usage

1
abbreviation(x, choices)

Arguments

x

A character string, and consists of some or all letters in a value in choices or may equal choices.

choices

A vector of character strings.

Details

The function abbreviation returns a value in choices specified by x, which may be an abbreviation. If no such abbreviation exists, then the original value of x is returned.

Value

The value in choices, which can be abbreviated by x.

Author(s)

Steven T. Garren, James Madison University, Harrisonburg, Virginia, USA

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
choices = c("two.sided", "less", "greater")

abbreviation( "two", choices ) 

abbreviation( "l", choices ) 

abbreviation( "gr", choices ) 

abbreviation( "greater", choices ) 

abbreviation( "Not in choices", choices )

Example output

[1] "two.sided"
[1] "less"
[1] "greater"
[1] "greater"
[1] "Not in choices"

jmuOutlier documentation built on Aug. 6, 2019, 1:03 a.m.