These functions convert data frame to corpus objects same as those constructed with corpus, VCorpus, and PCorpus. The list-column comment of the original post data frame is dropped for not complicating the data structure of the corpus.

post2qcorp(df, ...)

post2tmcorp(df, PCorpus = FALSE, ...)

Arguments

df

Data frame. A data frame generated by post2df.

...

Additional arguments passed on to corpus, VCorpus, or PCorpus.

PCorpus

Logical. Whether to contruct corpus with PCorpus. If FALSE, uses VCorpus. Defaults to FALSE.

See also

Examples

library(quanteda)
post_df  <- example_posts()
post_corp <- post2qcorp(post_df)

summary(post_corp)

library(tm)
post_df  <- example_posts()
post_corp <- post2tmcorp(post_df)

inspect(post_corp)
meta(post_corp, "author")