data("crude")
tdm <- TermDocumentMatrix(crude, control = list(weighting = weightTfIdf, stopwords = TRUE))
dtm <- DocumentTermMatrix(crude, control = list(weighting = weightTfIdf, stopwords = TRUE))
inspect(tdm[165:170,1:5])
inspect(dtm[1:5,165:170])
Run the code above in your browser using DataLab