View source: R/NAME_count_lexicon_df.R
count_lexicon_df | R Documentation |
Counts the number of times a string is detected in a lexicon, according to a (regex) pattern This function is based on a inner join of the text and the dictionary.
count_lexicon_df(data, lexicon, col, group)
data |
tibble where text data (corpus) is stored |
lexicon |
vector of target words which should be counted in |
col |
String in which the occurences of words from lexicon should be counted |
group |
grouping variable |
Number of hits of text in dictionary
my_txt <- c("Hello you! Too bad you are not here")
my_dict <- c("Bad", "good")
count_lexicon(my_txt, my_dict)
1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.