rmrp: Remove Repeated Pattern

View source: R/functions.R

rmrpR Documentation

Remove Repeated Pattern

Description

Remove a repeated pattern in a character vector.

Usage

rmrp(s, pattern, ...)

Arguments

s

a character vector

pattern

a regular expression

...

arguments passed to grep

Details

rmrp removes a repeated pattern in a character vector (e.g. repeated blank lines).

Value

a character vector

Author(s)

Enrico Schumann

See Also

strwrap, format

Examples

## remove repeated blanks from vector
s <- c("* Header", "", "  ","", "** Subheader")
rmrp(s, "^ *$")

textutils documentation built on May 29, 2024, 10:37 a.m.