I am new to R. I have a CSV file that includes 15000 rows of text, each row belongs to one person. I want to do Latent Dirichlet Allocation on it. But, first I need to create a term document matrix. However, I don't know how to make R to treat each row as a document. Here is what I've done, but it doesn't look correct:
text <- read.csv("text.csv", stringsAsFactors = FALSE)
corpus Corpus(VectorSource(text))
corpus <- tm_map(corpus, content_transformer(removePunctuation))
corpus <- tm_map(corpus, removeWords, stopwords("english"))
corpus <- tm_map(corpus, removeNumbers)
corpus <- tm_map(corpus, stemDocument)
corpus <- tm_map(corpus, stripWhitespace)
dtm <- DocumentTermMatrix(corpus)
the current dtm doesn't look like having all the terms in all the documents in columns. I feel like they're only words in each document.
I really appreciate your help