getPhrases {phm} | R Documentation |
Display Frequency Matrix for Documents
Description
Display a frequency matrix containing all the documents for which the indices are given in docs with their principal phrases and the number of times they occur in each document.
Usage
getPhrases(pd, doc, ids = TRUE)
Arguments
pd |
A phraseDoc object |
doc |
An integer vector containing indices of documents, or a character vector containing the ids of documents (column names) |
ids |
A logical value with TRUE (default) to return ids (if available), FALSE to return indices |
Value
A matrix with the documents and # of occurrences of principal phrases
for the documents in docs
Examples
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)
getPhrases(pd, c(1,3))
[Package phm version 1.1.2 Index]