createDTM {BullsEyeR}R Documentation

Create Document term Matrix

Description

The function createDTM creates a document term matrix after preprocessing and removal of stop words.

Usage

createDTM(ds, spvar = 0.99, myStopWords = NULL, stemvar = 0)

Arguments

ds

a character vector of text documents

spvar

a sparsity variable which defaults to 0.99

myStopWords

a character vector of custom stop words which defaults to NULL

stemvar

a variable indicating stemming to be performed or not which defaults to '0' meaning no stemming

Value

A Document Term Matrix.

Examples

## Not run: 
# Run it and see for yourself

## End(Not run)
data.tmp<-read.csv(system.file("ext", "testdata.csv", package="BullsEyeR"))
ds<-as.character(data.tmp$Story[1:2])
stopwords<-c("sallin","hannah","company","number","started","unlike")
createDTM(ds=ds,spvar=0.99,myStopWords=stopwords,stemvar=0)

[Package BullsEyeR version 0.2.0 Index]