as.matrix.phraseDoc | R Documentation |
Convert a phraseDoc Object to a Matrix
## S3 method for class 'phraseDoc'
as.matrix(x, ids = TRUE, sparse = FALSE, ...)
x |
A phraseDoc object. |
ids |
A logical value with TRUE (default) to use ids (if available), FALSE to use indices |
sparse |
A logical value indicates whether a sparse matrix should be returned (default FALSE) |
... |
Additional arguments |
A matrix with phrases as rows, texts as columns, and elements containing the number of times the phrase occurs in the text
tst=c("This is a test text",
"This is a test text 2",
"This is another test text",
"This is another test text 2",
"This girl will test text that man",
"This boy will test text that man")
pd=phraseDoc(tst)
as.matrix(pd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.