tot_n_tokens | R Documentation |
These methods retrieve or set the total number of tokens in
the corpus on which the frequency counts are based.
This total number of tokens may be higher than the sum of all frequency
counts in x
, for instance, if x
contains frequency counts
for a selection of items only, and not for all tokens in the corpus.
tot_n_tokens(x) tot_n_tokens(x) <- value ## S3 replacement method for class 'freqlist' tot_n_tokens(x) <- value ## S3 method for class 'freqlist' tot_n_tokens(x)
x |
An object of any of the classes for which the method is implemented. |
value |
Numerical value. |
A number.
Other getters and setters:
n_tokens()
,
n_types()
,
orig_ranks()
,
ranks()
,
type_names()
x <- freqlist("The man and the mouse.", re_token_splitter = "(?xi) [:\\s.;,?!\"]+", as_text = TRUE) x tot_n_tokens(x) y <- keep_types(x, c("man", "and")) tot_n_tokens(y) y tot_n_tokens(y) <- sum(y) y tot_n_tokens(y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.