# cbind() for dfm objects
(dfm1 <- dfm("This is one sample text sample.", verbose = FALSE))
(dfm2 <- dfm("More words here.", verbose = FALSE))
cbind(dfm1, dfm2)
# rbind() for dfm objects
(dfm1 <- dfm(c(doc1 = "This is one sample text sample."), verbose = FALSE))
(dfm2 <- dfm(c(doc2 = "One two three text text."), verbose = FALSE))
(dfm3 <- dfm(c(doc3 = "This is the fourth sample text."), verbose = FALSE))
rbind(dfm1, dfm2)
rbind(dfm1, dfm2, dfm3)
Run the code above in your browser using DataLab