tdm_tidiers

0th

Percentile

Tidy DocumentTermMatrix, TermDocumentMatrix, and related objects from the tm package

Tidy a DocumentTermMatrix or TermDocumentMatrix into a three-column data frame: term{}, and value (with zeros missing), with one-row-per-term-per-document.

Usage
# S3 method for DocumentTermMatrix
tidy(x, ...)

# S3 method for TermDocumentMatrix tidy(x, ...)

# S3 method for dfm tidy(x, ...)

# S3 method for dfmSparse tidy(x, ...)

# S3 method for simple_triplet_matrix tidy(x, row_names = NULL, col_names = NULL, ...)

Arguments
x

A DocumentTermMatrix or TermDocumentMatrix object

...

Extra arguments, not used

row_names

Specify row names

col_names

Specify column names

Aliases
  • tdm_tidiers
  • tidy.DocumentTermMatrix
  • tidy.TermDocumentMatrix
  • tidy.dfm
  • tidy.dfmSparse
  • tidy.simple_triplet_matrix
Examples
# NOT RUN {
if (requireNamespace("topicmodels", quietly = TRUE)) {
  data("AssociatedPress", package = "topicmodels")
  AssociatedPress

  tidy(AssociatedPress)
}

# }
Documentation reproduced from package tidytext, version 0.2.2, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.