Learn R Programming

quanteda (version 0.9.8.5)

selectFeaturesOLD: old version of selectFeatures.tokenizedTexts

Description

Calls C++ for super-fast selection or removal of features from a set of tokens.

Usage

selectFeaturesOLD(x, ...)
"selectFeaturesOLD"(x, features, selection = c("keep", "remove"), valuetype = c("glob", "regex", "fixed"), case_insensitive = TRUE, verbose = TRUE, ...)

Arguments

x
object whose features will be selected
...
supplementary arguments passed to the underlying functions in stri_detect_regex. (This is how case_insensitive is passed, but you may wish to pass others.)
features
one of: a character vector of features to be selected, a dfm whose features will be used for selection, or a dictionary class object whose values (not keys) will provide the features to be selected. For dfm objects, see details in the Value section below.
selection
whether to keep or remove the features
valuetype
how to interpret feature vector: fixed for words as is; "regex" for regular expressions; or "glob" for "glob"-style wildcard
case_insensitive
ignore the case of dictionary values if TRUE
verbose
if TRUE print message about how many features were removed

Examples

Run this code
toks <- tokenize(c("This is some example text from me.", "More of the example text."), 
                 removePunct = TRUE)
selectFeaturesOLD(toks, stopwords("english"), "remove")
selectFeaturesOLD(toks, "ex", "keep", valuetype = "regex")

Run the code above in your browser using DataLab