n_types {mclm} | R Documentation |
Count types
Description
This method returns the number of types in an object.
Usage
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, ...)
Arguments
x |
An object of any of the classes for which the method is implemented. |
... |
Additional arguments. |
Value
A number.
See Also
Other getters and setters:
n_tokens()
,
orig_ranks()
,
ranks()
,
tot_n_tokens()
,
type_names()
Examples
(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)
[Package mclm version 0.2.7 Index]