makeChunks {tm} | R Documentation |
Split a corpus into equally sized chunks conserving document boundaries.
makeChunks(corpus, chunksize)
corpus |
The corpus to be split into chunks. |
chunksize |
The chunk size. |
A corpus consisting of the chunks. Note that corpus meta data is not passed on to the newly created chunk corpus.
Ingo Feinerer
txt <- system.file("texts", "txt", package = "tm") ovid <- Corpus(DirSource(txt)) sapply(ovid, length) ovidChunks <- makeChunks(ovid, 5) sapply(ovidChunks, length)