EVOLUTION-MANAGER
Edit File: document_term_casters.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Casting a data frame to a DocumentTermMatrix,...</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for cast_tdm {tidytext}"><tr><td>cast_tdm {tidytext}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Casting a data frame to a DocumentTermMatrix, TermDocumentMatrix, or dfm</h2> <h3>Description</h3> <p>This turns a "tidy" one-term-per-document-per-row data frame into a DocumentTermMatrix or TermDocumentMatrix from the tm package, or a dfm from the quanteda package. These functions support non-standard evaluation through the tidyeval framework. Groups are ignored. </p> <h3>Usage</h3> <pre> cast_tdm(data, term, document, value, weighting = tm::weightTf, ...) cast_dtm(data, document, term, value, weighting = tm::weightTf, ...) cast_dfm(data, document, term, value, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>data</code></td> <td> <p>Table with one-term-per-document-per-row</p> </td></tr> <tr valign="top"><td><code>term</code></td> <td> <p>Column containing terms as string or symbol</p> </td></tr> <tr valign="top"><td><code>document</code></td> <td> <p>Column containing document IDs as string or symbol</p> </td></tr> <tr valign="top"><td><code>value</code></td> <td> <p>Column containing values as string or symbol</p> </td></tr> <tr valign="top"><td><code>weighting</code></td> <td> <p>The weighting function for the DTM/TDM (default is term-frequency, effectively unweighted)</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Extra arguments passed on to <code><a href="../../Matrix/html/sparseMatrix.html">sparseMatrix</a></code></p> </td></tr> </table> <h3>Details</h3> <p>The arguments <code>term</code>, <code>document</code>, and <code>value</code> are passed by expression and support <a href="../../rlang/html/quasiquotation.html">quasiquotation</a>; you can unquote strings and symbols. </p> <hr /><div style="text-align: center;">[Package <em>tidytext</em> version 0.3.4 <a href="00Index.html">Index</a>]</div> </body></html>