Learn R Programming

RVerbalExpressions (version 0.0.0.9000)

rx_digit: Match a digit (0<U+2013>9).

Description

The function rx_digit()looks for tabs with the following expression: %%d and matches single digit. Plural version matches specified number of digits n (equivalent to rx_digit() %>% rx_count(n)).

Usage

rx_digit(.data = NULL, inverse = FALSE)

Arguments

.data

Expression to append, typically pulled from the pipe %>%

inverse

Invert match behavior, defaults to FALSE (match digit characters). Use TRUE to not match digit characters.

Details

This function is looks for tabs with the following expression: \d

Examples

Run this code
# NOT RUN {
rx_digit()
rx_digit(inverse = TRUE)

# create an expression
x <- rx_digit()

# create input
string <- "1 apple"

# extract match
regmatches(string, regexpr(x, string))
# }

Run the code above in your browser using DataLab