n_types | R Documentation |
This method returns the number of types in an object.
n_types(x, ...) ## S3 method for class 'assoc_scores' n_types(x, ...) ## S3 method for class 'freqlist' n_types(x, ...) ## S3 method for class 'tokens' n_types(x, ...) ## S3 method for class 'types' n_types(x, ...)
x |
An object of any of the classes for which the method is implemented. |
... |
Additional arguments. |
A number.
Other getters and setters:
n_tokens()
,
orig_ranks()
,
ranks()
,
tot_n_tokens()
,
type_names()
(tks <- tokenize("The old man and the sea.")) # for a types object ---------- (tps <- types(tks)) n_types(tps) # for a freqlist object ------- (flist <- freqlist(tks)) n_tokens(flist) n_types(flist) # for an assoc_scores object -- a <- c(10, 30, 15, 1) b <- c(200, 1000, 5000, 300) c <- c(100, 14, 16, 4) d <- c(300, 5000, 10000, 6000) types <- c("four", "fictitious", "toy", "examples") (scores <- assoc_abcd(a, b, c, d, types = types)) n_types(scores)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.