magrep: Wrappers to grep and gsub functions

Description Usage Arguments Details See Also

Description

Wrappers to common grep functions for compatability with the magrittr style of programming

Usage

1
2
3
4
5
magrep(x, pattern, ...)

magrepl(x, pattern, ...)

magsub(x, pattern, replacement, ...)

Arguments

x

a character vector where matches are sought, or an object which can be coerced by as.character to a character vector

pattern

character string containing a regular expression (or character string for fixed = TRUE) to be matched in the given character vector.

...

additional arguments passed to grep, grepl and gsub

replacement

a replacement for matched pattern in sub and gsub. Coerced to character if possible.

Details

These return the same as the functions grep, grepl and gsub, but have the character placed first for easy integration with the magrittr pipe and lapply functions.

See Also

grep, grepl and gsub


steveped/spShortcuts documentation built on May 30, 2019, 5:39 p.m.