Description Usage Arguments Examples
Given a TermDocumentMatrix or DocumentTermMatrix object, the function converts it to a matrix or write it into a .csv file, with additional filenames attached to it.
1 | output_dtm(x, outputfile = NULL, doc_name = NULL)
|
x |
an object created by |
outputfile |
when it is NULL (default), no file is written and a matrix is returned. When a filename is provided, it will write the matrix into a file. The filename must end with ".csv". |
doc_name |
whether |
1 2 3 4 5 6 7 8 | require(tm)
x <- c(
"Hello, what do you want to drink?",
"drink a bottle of milk",
"drink a cup of coffee",
"drink some water")
dtm <- corp_or_dtm(x, from = "v", type = "dtm")
output_dtm(dtm, doc_name = paste("doc", 1:4))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.