Description Usage Arguments Value See Also Examples
Generate a term frequency vector from a text document.
1 |
doc |
An object inheriting from |
control |
A list of control options which override default settings. First, following two options are processed.
Next, a set of options which are sensitive to the order of
occurrence in the
Finally, following options are processed in the given order.
|
A table of class c("term_frequency", "integer")
with term frequencies
as values and tokens as names.
1 2 3 4 5 6 7 8 9 10 | data("crude")
termFreq(crude[[14]])
strsplit_space_tokenizer <- function(x)
unlist(strsplit(as.character(x), "[[:space:]]+"))
ctrl <- list(tokenize = strsplit_space_tokenizer,
removePunctuation = list(preserve_intra_word_dashes = TRUE),
stopwords = c("reuter", "that"),
stemming = TRUE,
wordLengths = c(4, Inf))
termFreq(crude[[14]], control = ctrl)
|
Loading required package: NLP
"none (bpd). 13-nation 948,000 above
1 1 1 1 1
after al-khalifa al-qabas al-sabah ali
1 1 1 1 1
also analysts and asked barrels
1 1 1 1 1
bpd crude daily denied emergency
1 2 2 1 1
estimated fell for has international
1 1 2 1 1
interview its kuwait kuwait's last
1 2 1 1 1
limits. local meeting meeting." members
1 1 1 1 1
million minister newspaper oil one
1 1 1 4 1
opec over plans prices prices.
4 1 1 1 1
pumping quota quoted recent reuter
2 1 1 1 1
said saying self-imposed sharply sheikh
1 1 1 1 1
such that the there traders
1 3 4 1 1
was weakness week were world
3 1 1 1 1
13-nation 948000 abov after al-khalifa al-qaba al-sabah
1 1 1 1 1 1 1
also analyst barrel crude daili deni emerg
1 1 1 2 2 1 1
estim fell intern interview kuwait last limit
1 1 1 1 2 1 1
local meet member million minist newspap none
1 2 1 1 1 1 1
opec over plan price pump quot quota
4 1 1 2 2 1 1
recent said self-impos sharpli sheikh such there
1 1 1 1 1 1 1
trader weak week were world
1 1 1 1 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.