| tm_combine {tm} | R Documentation |
Combine several corpora into a single one, combine multiple documents into a corpus, combine multiple term-document matrices into a single one, or combine multiple term frequency vectors into a single term-document matrix.
## S3 method for class 'Corpus' c(..., recursive = FALSE) ## S3 method for class 'TextDocument' c(..., recursive = FALSE) ## S3 method for class 'TermDocumentMatrix' c(..., recursive = FALSE) ## S3 method for class 'term_frequency' c(..., recursive = FALSE)
... |
Corpora, text documents, term-document matrices, or term frequency vectors. |
recursive |
Logical. If |
If recursive = TRUE, meta data from input objects (corpora or
documents) is preserved during concatenation and intelligently merged
into the newly created corpus. Although we use a sophisticated merging
strategy (by using a binary tree for corpus specific meta data and by
joining document level specific meta data in data frames) you should
check the newly created meta data for consistency when merging corpora
with (partly) identical meta data. However, in most cases the meta
data merging strategy will produce validly combined and arranged meta
data structures.
Corpus, TextDocument,
TermDocumentMatrix, and termFreq.
data("acq")
data("crude")
summary(c(acq, crude))
summary(c(acq[[30]], crude[[10]]))
c(TermDocumentMatrix(acq), TermDocumentMatrix(crude))