dtm {wactor} | R Documentation |
Document term frequency
Description
Converts character vector into document term matrix (dtm)
Usage
dtm(object, .x = NULL)
Arguments
object |
Input object containing dictionary (column), e.g., wactor |
.x |
Text from which the document term matrix will be created |
Value
A c-style matrix
Examples
## create wactor
w <- wactor(letters)
## use wactor to create dtm of same vector
dtm(w, letters)
## using the initial data is the default; so you don't actually have to
## respecify it
dtm(w)
## use wactor to create dtm on new vector
dtm(w, c("a", "e", "i", "o", "u"))
## apply directly to character vector
dtm(letters)
[Package wactor version 0.0.1 Index]