Learn R Programming

RVerbalExpressions (version 0.0.0.9000)

range: Match any character within the range defined by the parameters.

Description

Value parameter will be interpreted as pairs. For example, range(c('a', 'z', '0', '9')) will be interpreted to mean any character within the ranges a<U+2013>z (ascii x<U+2013>y) or 0<U+2013>9 (ascii x<U+2013>y). The method expects an even number of parameters; unpaired parameters are ignored.

Usage

range(.data = NULL, value)

Arguments

.data

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

value

Range of characters. The method expects an even number of parameters; unpaired parameters are ignored.

Examples

Run this code
# NOT RUN {
range(value = c('1', '3'))

# create an expression
x <- range(value = c('1', '3'))

grepl(x, "2") # should be true
grepl(x, "4") # should be false
# }

Run the code above in your browser using DataLab