View source: R/word_frequency.R
word_frequency | R Documentation |
word_frequency()
map terms from a vector using the tm
package system and outputs a tibble summarizing word
frequencies.
Please note that word_frequency()
is required for other iramuteqlike
functions.
word_frequency(
x,
language = "en",
stopwords = language,
other_stopwords = NULL
)
x |
An atomic vector (usually a
character object) with a corpus (a collection of documents
containing text). Each element of |
language |
(optional) a string indicating the corpus language. See
|
stopwords |
(optional) a string indicating the corpus language to be
pass to |
other_stopwords |
(optional) a string indicating other stop words to be removed from the text analysis. |
A tibble
object with two columns:
word
: with an unique set of words mapped from x
.
freq
: with the absolute frequency of a word in word
.
if (requireNamespace("friends", quietly = TRUE)) {
word_frequency(head(friends::friends[[1]], 100))
}
if (requireNamespace("stringi", quietly = TRUE)) {
word_frequency(stringi::stri_rand_lipsum(5))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.