Skip to contents

strs_isnumeric checks whether each element of a character vector contains only numeric characters. It is similar to Python's str.isnumeric() method.

Usage

strs_isnumeric(string)

Arguments

string

A character vector to be checked.

Value

A logical vector of the same length as string, indicating whether each element contains only numeric characters.

Examples

strs_isnumeric("12345")
#> [1] TRUE
strs_isnumeric("123a") # contains a non-numeric character
#> [1] FALSE