Takes a keyword and vector of text and returns instances where the keyword is found within the text.
ctgov_kwic(
term,
text,
names = NULL,
n = Inf,
ignore_case = TRUE,
use_color = FALSE,
width = 20L,
output = c("cat", "character", "data.frame")
)either nothing, character vector, or data frame depending on the the requested return type
search term as a string
vector of text to search
optional vector of names corresponding to the text
number of results to return; default is Inf
should search ignore case? default is TRUE
printed results include ASCII color escape sequences;
these are set to FALSE because they only work
correctly when returned in the terminal
how many characters to show as context
what kind of output to provide; default prints the
results using cat