getDigits: Extract digits from a character vector

View source: R/getDigits.R

getDigitsR Documentation

Extract digits from a character vector

Description

This function extracts all digits found in character vector and returns them as a list.

Usage

getDigits(x, collapse = NULL)

Arguments

x

a character vector where digits are sought, or an object which can be coerced by as.character to a character vector.

collapse

an optional character string to separate the results (see [base::paste()).

Value

A list of digits.

Examples

getDigits('txt012-34')

letiR/letiRmisc documentation built on Sept. 11, 2022, 12:43 a.m.