powered by
Coercion functions to and from tokens objects, checks for whether an object is a tokens object, and functions to combine tokens objects.
as.tokens(x)# S3 method for list as.tokens(x)# S3 method for collocations as.tokens(x)# S3 method for tokens as.list(x, ...)# S3 method for tokens unlist(x, recursive = FALSE, use.names = TRUE)# S3 method for tokens as.character(x, use.names = FALSE, ...)is.tokens(x)# S3 method for tokens +(t1, t2)# S3 method for tokens c(...)
# S3 method for list as.tokens(x)
# S3 method for collocations as.tokens(x)
# S3 method for tokens as.list(x, ...)
# S3 method for tokens unlist(x, recursive = FALSE, use.names = TRUE)
# S3 method for tokens as.character(x, use.names = FALSE, ...)
is.tokens(x)
# S3 method for tokens +(t1, t2)
# S3 method for tokens c(...)
object to be coerced or checked
for c.tokens only, tokens objects to be concatenated
a required argument for unlist but inapplicable to tokens objects
logical; preserve names if TRUE. For as.character and unlist only.
TRUE
as.character
unlist
tokens one to be added
tokens two to be added
as.tokens returns a quanteda tokens object
as.tokens
as.list returns a simple list of characters from a tokens object
as.list
unlist returns a simple vector of characters from a tokens object
as.character returns a character vector from a tokens object
is.tokens returns TRUE if the object is of class tokens, FALSE otherwise.
is.tokens
FALSE
c(...) and + return a tokens object whose documents have been added as a single sequence of documents.
c(...)
+
# NOT RUN { # combining tokens toks1 <- tokens(c("a b c d e", "f g h")) toks2 <- tokens(c("1 2 3")) toks1 + toks2 c(toks1, toks2) # }
Run the code above in your browser using DataLab