Learn R Programming

mclm (version 0.2.7)

n_tokens: Count tokens

Description

This method returns the number of tokens in an object.

Usage

n_tokens(x, ...)

# S3 method for freqlist n_tokens(x, ...)

# S3 method for tokens n_tokens(x, ...)

Value

A number.

Arguments

x

An object of any of the classes for which the method is implemented.

...

Additional arguments.

See Also

Other getters and setters: n_types(), orig_ranks(), ranks(), tot_n_tokens(), type_names()

Examples

Run this code
(tks <- tokenize("The old man and the sea."))
n_tokens(tks)

(flist <- freqlist(tks))
n_tokens(flist)
n_types(flist)

Run the code above in your browser using DataLab