Learn R Programming

strs (version 0.1.0)

strs_isnumeric: Check if string contains only numeric characters

Description

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)

Value

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

Arguments

string

A character vector to be checked.

See Also

Examples

Run this code
strs_isnumeric("12345")
strs_isnumeric("123a") # contains a non-numeric character

Run the code above in your browser using DataLab