EVOLUTION-MANAGER
Edit File: cast_sparse.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: Create a sparse matrix from row names, column names, and...</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_sparse {tidytext}"><tr><td>cast_sparse {tidytext}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Create a sparse matrix from row names, column names, and values in a table.</h2> <h3>Description</h3> <p>This function supports non-standard evaluation through the tidyeval framework. </p> <h3>Usage</h3> <pre> cast_sparse(data, row, column, value, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>data</code></td> <td> <p>A tbl</p> </td></tr> <tr valign="top"><td><code>row</code></td> <td> <p>Column name to use as row names in sparse matrix, as string or symbol</p> </td></tr> <tr valign="top"><td><code>column</code></td> <td> <p>Column name to use as column names in sparse matrix, as string or symbol</p> </td></tr> <tr valign="top"><td><code>value</code></td> <td> <p>Column name to use as sparse matrix values (default 1) as string or symbol</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Extra arguments to pass on to <code><a href="../../Matrix/html/sparseMatrix.html">sparseMatrix</a></code></p> </td></tr> </table> <h3>Details</h3> <p>Note that cast_sparse ignores groups in a grouped tbl_df. The arguments <code>row</code>, <code>column</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> <h3>Value</h3> <p>A sparse Matrix object, with one row for each unique value in the <code>row</code> column, one column for each unique value in the <code>column</code> column, and with as many non-zero values as there are rows in <code>data</code>. </p> <h3>Examples</h3> <pre> dat <- data.frame(a = c("row1", "row1", "row2", "row2", "row2"), b = c("col1", "col2", "col1", "col3", "col4"), val = 1:5) cast_sparse(dat, a, b) cast_sparse(dat, a, b, val) </pre> <hr /><div style="text-align: center;">[Package <em>tidytext</em> version 0.3.4 <a href="00Index.html">Index</a>]</div> </body></html>