I have a table (Data frame) myTable
with a single column as follows:
sentence
1 it is a window
2 My name is john doe
3 Thank you
4 Good luck
.
.
.
I want to convert it to a Term Document Matrix in R. I did this:
tdm_s <- TermDocumentMatrix(Corpus(DataframeSource(myTable)))
but I got this error:
Error: all(!is.na(match(c("doc_id", "text"), names(x)))) is not TRUE
I googled and couldn't find anything. How can I do this conversion?
DataframeSource()
expect? IsmyTable
of that type? – AkselA Jan 15 '18 at 13:16myTable
is adataframe
. Besides, I passedCorpus(DataframeSource(myTable))
to theTermDocumentMatrix()
, notmyTable
. @AkselA – Patris Jan 15 '18 at 13:22DataframeSource(myTable)
the error occurs. @AkselA – Patris Jan 15 '18 at 13:39