if (require(polmineR.sampleCorpus) && require(rcqp)){
use("polmineR.sampleCorpus")
p <- partition("PLPRBTTXT", text_date=".*", regex=TRUE)
pB <- partitionBundle(p, def=list(text_date=NULL))
pB <- enrich(pB, pAttribute="word")
tdm <- as.TermDocumentMatrix(pB, col="count")
pB2 <- partitionBundle(p, def=list(text_date=NULL))
tdm <- as.TermDocumentMatrix(pB2, pAttribute="word")
}
Run the code above in your browser using DataLab