Learn R Programming

qdap (version 0.2.5)

tdm: Convert/Generate Term Document Matrix

Description

Create term document matrices from raw text or wfm for use with other text analysis packages.

Usage

tdm(text.var, grouping.var = NULL, ...)

Arguments

text.var
The text variable or a wfm object.
grouping.var
The grouping variables. Default NULL generates one word list for all text. Also takes a single grouping variable or a list of 1 or more grouping variables.
...
Other arguments passed to wfm.

Details

Similar to the tm package's TermDocumentMatrix though not identical.

Examples

Run this code
x <- wfm(DATA$state, DATA$person)
tdm(x)
library(lsa)
lsa(tdm(x), dims=dimcalc_share())
lsa(tdm(DATA$state, DATA$person), dims=dimcalc_share())

Run the code above in your browser using DataLab