context_grabber: Retrieve the 1-5 word boundaries before and 1-10 after a...

View source: R/context_grabber.R

context_grabberR Documentation

Retrieve the 1-5 word boundaries before and 1-10 after a pattern.

Description

Boundaries are broken up by spaces (super basic)

Usage

context_grabber(
  data,
  text_var = mention_content,
  pattern,
  range_before = 5,
  range_after = 10,
  show_pattern = FALSE
)

Arguments

data

Data frame or tibble object

text_var

Name of the text variable

pattern

Pattern to search for - should be a character vector

range_before

Number of words before

range_after

Number of words after

show_pattern

Whether to print the pattern as well as the context tibble

Value

a tibble of the extracted contexts


jpcompartir/JPackage documentation built on March 20, 2023, 4 a.m.