needleInHaystack: Find a Needle in a Haystack...

Description Usage Arguments Value Author(s) References Examples

View source: R/needleInHaystack.R

Description

Find specified search patterns (in any order, not necessarily joined) in another vector of strings.

Usage

1
needleInHaystack(findMe, findIn)

Arguments

findMe

What are you looking for? A character vector.

findIn

Where are you looking for it? A character vector.

Value

A matrix with 1 indicating presence and 0 indicating absence.

Author(s)

Ananda Mahto

References

http://stackoverflow.com/q/22129542/1270695

Examples

1
2
3
4
x <- c("cat", "dog", "rat", "far", "f*n", "god", "g*dn")
y <- c("ar", "n*", "a", "zo")

needleInHaystack(y, x)

mrdwab/SOfun documentation built on June 20, 2020, 6:15 p.m.