View source: R/text_searching.R
| make.phrase.matrix | R Documentation |
Generate a n by p phrase count matrix, with n being number of documents and p being number of phrases:
| 0 | 0 | 0 | 0 | 0 |
| 1 | 6 | 2 | 0 | 0 |
| 8 | 0 | 0 | 0 | 0 |
This is the phrase equivilent of a document-term matrix.
make.phrase.matrix(phrase_list, corpus)
phrase_list |
List of strings |
corpus |
A corpus object from tm package |
a n X p matrix, n being number of documents, p being number of phrases.
Other textregCounting:
make.count.table(),
phrase.count()
library( tm )
data( bathtub )
lbl = meta( bathtub )$meth.chl
head( make.phrase.matrix( c("bathtub","strip+", "vapor *"), bathtub ) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.