Learn R Programming

quanteda (version 0.9.9-3)

as.tokens: coercion and checking functions for tokens objects

Description

Coerce a list of character elements to a quanteda tokens object, or check whether an object is a tokens object.

Usage

as.tokens(x)
"as.tokens"(x)
"as.list"(x, ...)
"as.character"(x, use.names = FALSE, ...)
is.tokens(x)

Arguments

x
list of character elements
...
unused
use.names
logical; preserve names if TRUE. For as.character.tokens only.

Value

as.tokens returns a quanteda tokens objectas.list.tokens returns a simple list of characters from a tokens objectas.character.tokens returns a character vector from a tokens objectis.tokens returns TRUE if the object is of class tokens, FALSE otherwise.