| extract_context | R Documentation | 
A function for getting string matches and the context in which they occur.
extract_context(match, v, level = "sentences", n = 1)
match | 
 Character string to be matched. For multiple strings, please use "|" as a separator.  | 
v | 
 Text vector or annotated data frame.  | 
level | 
 At which text level do you want matches to be returned? Defaults to "sentences". Options are sentences, words, and paragraph.  | 
n | 
 Number of sentences or words matched before and after string match. Defaults to 1. That is, one word or one sentence before, and after, string match. For paragraphs, n is always set to one.  | 
A list of string matches and their context.
extract_context(match = "war|weapons of mass destruction|conflict|NATO|peace",
                v = US_News_Conferences_1960_1980$text[100],
                level = "sentences", n = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.