findPat {PBSmodelling} | R Documentation |
Search a Character Vector to Find Multiple Patterns
Description
Use all available patterns in pat
to search in vec
,
and return the matched elements in vec
.
Usage
findPat(pat, vec)
Arguments
pat |
character vector of patterns to match in |
vec |
character vector where matches are sought |
Value
A character vector of all matched strings.
Author(s)
Rowan Haigh, Pacific Biological Station, Fisheries and Oceans Canada, Nanaimo BC
Examples
local(envir=.PBSmodEnv,expr={
#find all strings with a vowel, or that start with a number
print(findPat(c("[aeiou]", "^[0-9]"), c("hello", "WORLD", "1over")))
})
[Package PBSmodelling version 2.69.3 Index]