str_extract_context_all: Extract all patterns from a string along with characters that...

Description Usage Arguments Value Examples

View source: R/str_extract_context_all.R

Description

#' Vectorised over 'string', 'pattern', and 'window_size'.

Usage

1
str_extract_context_all(string, pattern, window_size = 10)

Arguments

string

The string from which to extract.

pattern

Pattern to look for.

window_size

Number of characters to return before and after the pattern.

Value

A character vector with pattern matches and their context.

Examples

1
2
test_string <- 'To be or not to be, that is the question.'
str_extract_context_all(test_string, pattern = 'be', window_size = 4)

johncassil/stringr.plus documentation built on Oct. 9, 2021, 7:56 p.m.