Learn R Programming

jmuOutlier (version 2.2)

abbreviation: Allows Abbreviations of Character Data

Description

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

Usage

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.

Value

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

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.

Examples

Run this code
# NOT RUN {
choices = c("two.sided", "less", "greater")

abbreviation( "two", choices ) 

abbreviation( "l", choices ) 

abbreviation( "gr", choices ) 

abbreviation( "greater", choices ) 

abbreviation( "Not in choices", choices )
# }

Run the code above in your browser using DataLab