as.matrix.phraseDoc: Convert a phraseDoc Object to a Matrix

Description Usage Arguments Value Examples

View source: R/as.matrix.phraseDoc.R

Description

Convert a phraseDoc Object to a Matrix

Usage

1
2
## S3 method for class 'phraseDoc'
as.matrix(x, ...)

Arguments

x

A phraseDoc object.

...

Additional arguments to be passed to or from methods.

Value

A matrix with phrases as rows, texts as columns, and elements containing the number of times the phrase occurs in the text.

Examples

1
2
3
4
5
6
7
8
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)

phm documentation built on July 1, 2020, 6:54 p.m.

Related to as.matrix.phraseDoc in phm...