str_match: string match #' 'str_match' search for matches to argument...

Description Usage Arguments Examples

View source: R/data_process_tools.R

Description

string match #' str_match search for matches to argument pattern within each element of a character vector:

Usage

1

Arguments

pattern

character string containing a regular expression (or character string for fixed = TRUE) to be matched in the given character vector. Coerced by as.character to a character string if possible. If a character vector of length 2 or more is supplied, the first element is used with a warning. missing values are allowed except for regexpr and gregexpr.

str_r

a character vector where matches are sought, or an object which can be coerced by as.character to a character vector. Long vectors are supported.

Examples

1
2
orignal_nam = c("12mdd","11mdd","10mdd")
str_match(str_r = orignal_nam,pattern= "\\d+")

Example output

Package 'creditmodel' version 1.2.7
[1] "12m" "11m" "10m"

creditmodel documentation built on Jan. 7, 2022, 5:06 p.m.