match_letters: Match the first 'n' letters to supplied arguments

View source: R/Helpers.R

match_lettersR Documentation

Match the first n letters to supplied arguments

Description

Case insensitive matching of argument to possibilities provided in ellipsis.

Usage

match_letters(
  x,
  ...,
  n = 1,
  multiple = FALSE,
  ignore.case = FALSE,
  capitalize = FALSE
)

Arguments

x

(character) to match on

...

(character) vectors to match against

n

(numeric) how many characters of x to use in matching. Set to NULL to use all

multiple

(logical) are multiple matches allowed? If FALSE (Default) only the first match is returned.

ignore.case

if FALSE, the pattern matching is case sensitive and if TRUE, case is ignored during matching.

capitalize

(logical) whether to capitalize the result

Value

(character) vector of matches


jagg19/AlpacaforR documentation built on July 3, 2023, 12:14 p.m.