Description Usage Arguments Value Author(s) Examples
View source: R/search_term_collocations.R
A wrapper for search_term
+
frequent_terms
. Find words that frequently collocate
with a term(s). Note that the 'term
regexes are eliminated from the
output of top occurring terms.
1 | search_term_collocations(text.var, term, n = 10, ignore.case = TRUE, ...)
|
text.var |
A vector of character strings. |
term |
A regular expression(s) to search for (uses |
n |
The number of rows to print. If integer selects the frequency at the nth row and prints all rows >= that value. If proportional (less than 0) the frequency value for the nth% row is selected and prints all rows >= that value. |
ignore.case |
logical. Should |
... |
Other arguments passed to |
Returns a data.frame
of collocating terms and
frequencies.
Steve T. Simpson and Tyler Rinker <tyler.rinker@gmail.com>.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## Example 1
search_term_collocations(sam_i_am, "\\bsam")
search_term_collocations(sam_i_am, c('green', "\\bsam"))
search_term_collocations(sam_i_am, c('green', "\\bsam"), min.char=2)
## Example 2
top_colo <- search_term_collocations(
presidential_debates_2012[["dialogue"]],
"president",
n =50
)
top_colo
plot(top_colo)
plot(top_colo, as.cloud=TRUE)
## Example 3
top_colo_exclude <- search_term_collocations(
presidential_debates_2012[["dialogue"]],
"president",
exclude = "obama",
n =50
)
top_colo_exclude
plot(top_colo_exclude)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.