Description Usage Arguments Value See Also Examples
Removal of stop words in a variety of contexts .
%sw%
- Binary operator version of rm_stopwords
that
defaults to separate = FALSE
..
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 27 28 29 | rm_stopwords(
text.var,
stopwords = qdapDictionaries::Top25Words,
unlist = FALSE,
separate = TRUE,
strip = FALSE,
unique = FALSE,
char.keep = NULL,
names = FALSE,
ignore.case = TRUE,
apostrophe.remove = FALSE,
...
)
rm_stop(
text.var,
stopwords = qdapDictionaries::Top25Words,
unlist = FALSE,
separate = TRUE,
strip = FALSE,
unique = FALSE,
char.keep = NULL,
names = FALSE,
ignore.case = TRUE,
apostrophe.remove = FALSE,
...
)
text.var %sw% stopwords
|
text.var |
A character string of text or a vector of character strings. |
stopwords |
A character vector of words to remove from the text. qdap
has a number of data sets that can be used as stop words including:
|
unlist |
logical. If |
separate |
logical. If |
strip |
logical. IF |
unique |
logical. If |
char.keep |
If strip is |
names |
logical. If |
ignore.case |
logical. If |
apostrophe.remove |
logical. If |
... |
further arguments passed to |
Returns a vector of sentences, vector of words, or (default) a list of vectors of words with stop words removed. Output depends on supplied arguments.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
rm_stopwords(DATA$state)
rm_stopwords(DATA$state, tm::stopwords("english"))
rm_stopwords(DATA$state, Top200Words)
rm_stopwords(DATA$state, Top200Words, strip = TRUE)
rm_stopwords(DATA$state, Top200Words, separate = FALSE)
rm_stopwords(DATA$state, Top200Words, separate = FALSE, ignore.case = FALSE)
rm_stopwords(DATA$state, Top200Words, unlist = TRUE)
rm_stopwords(DATA$state, Top200Words, unlist = TRUE, strip=TRUE)
rm_stop(DATA$state, Top200Words, unlist = TRUE, unique = TRUE)
c("I like it alot", "I like it too") %sw% qdapDictionaries::Top25Words
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.