Learn R Programming

VarfromPDB (version 2.2.10)

grep_split: Extention for grep function

Description

grep a string whether in another string or vector, the string are split by space.

Usage

grep_split(keyword, x)

Arguments

keyword

a character string, separator "|" is permitted.

x

a character vector where matches are sought.

Value

The function return the numbers vector which contain the keyword.

Details

Extention for grep functin.

See Also

grep

Examples

Run this code
# NOT RUN {
x <- c("you and he and I", "you", "Tom", "I", "you and I", "he and I")
grep_split("you and I | Tom", x)
#[1] 1 5 3
# }

Run the code above in your browser using DataLab