Examining a DocumentTermMatrix in RTextTools I created a DocumentTermMatrix  for text mining using RTextTools. The rows for this DocumentTermMatrix  correspond to dataframe rows and matix columns correspond to words. My question is : How can I get the words (labels vector) for examining the DocumentTermMatrix  ? In other words, How can I get the vector of these 904 words?

require(RTextTools,quietly=TRUE)
data(USCongress)

doc_matrix &lt;- create_matrix(USCongress$text, language="english",   removeNumbers=TRUE, stemWords=TRUE, removeSparseTerms=.998)

dim(USCongress)
[1] 4449    6

dim(doc_matrix)
[1] 4449  904
a documenttermmatrix is a simple_triplet_matrix. You can turn this into a simple matrix with the as.matrix command and then use all matrix functions.

# turn into simple matrix
mat &lt;- as.matrix(doc_matrix)

# vector of the words 
word_vector &lt;- colnames(mat)

# Dataframe containing words and their frequency
df_words &lt;- data.frame(words = colnames(mat), frequency = colSums(mat), row.names = NULL)