grapes-like-grapes: x like y

%like%R Documentation

x like y

Description

Returns a logical vector of elements of x matching the regex y.

Usage

x %like% pattern

Arguments

x

a vector (numeric, character, factor)

pattern

a vector (numeric, character, factor), matching the mode of x

Value

A logical vector with length equal to x of things in x that are like y.

See Also

%like%, %nlike%, %nin%,

Examples

(Name <- c("Mary","George","Martha"))
Name %in% c("Mary")
Name %like% "^Mar"
Name %nin% c("George")
Name %nlike% "^Mar"

stephenturner/Tmisc documentation built on April 21, 2024, 8:31 a.m.