Learn R Programming

TextRegression (version 0.1-3)

dtm.to.Matrix: Transform a tm-style DTM into a sparse Matrix.

Description

Transform a DTM produced by the tm package into a sparse Matrix for use with the glmnet package.

Usage

dtm.to.Matrix(dtm)

Arguments

dtm
A document term matrix of class 'DocumentTermMatrix'.

Value

A sparse matrix (of class 'Matrix') representation of the DTM.

Examples

Run this code
## Not run: dtm.to.Matrix(dtm)

Run the code above in your browser using DataLab