Learn R Programming

do (version 2.0.0.1)

Grepl: Judge for Included Character

Description

Judge for Included Character

Usage

Grepl(pattern, x)

Value

a matrix with logical words

Arguments

pattern

one or more vectors

x

one or more vectors

Details

'

Examples

Run this code

a=c('abcd','agj','abcu')

# Grepl for one vector
pat1='b'
Grepl(pat1,a)

# Grepl for two vectors
pat2=c('c','d')
Grepl(pat2,a)

# use %or% in pattern
pat3=c('a%or%c','d')
Grepl(pat3,a)

# use %and% in pattern
pat4=c('a%and%c','d')
Grepl(pat4,a)

Run the code above in your browser using DataLab