EVOLUTION-MANAGER
Edit File: data_grid.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: Generate a data grid.</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 data_grid {modelr}"><tr><td>data_grid {modelr}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Generate a data grid.</h2> <h3>Description</h3> <p>To visualise a model, it is very useful to be able to generate an evenly spaced grid of points from the data. <code>data_grid</code> helps you do this by wrapping around <code><a href="../../tidyr/html/expand.html">tidyr::expand()</a></code>. </p> <h3>Usage</h3> <pre> data_grid(data, ..., .model = NULL) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>data</code></td> <td> <p>A data frame</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Variables passed on to <code><a href="../../tidyr/html/expand.html">tidyr::expand()</a></code></p> </td></tr> <tr valign="top"><td><code>.model</code></td> <td> <p>A model. If supplied, any predictors needed for the model not present in <code>...</code> will be filled in with "<a href="typical.html">typical</a>" values.</p> </td></tr> </table> <h3>See Also</h3> <p><code><a href="seq_range.html">seq_range()</a></code> for generating ranges from continuous variables. </p> <h3>Examples</h3> <pre> data_grid(mtcars, vs, am) # For continuous variables, seq_range is useful data_grid(mtcars, mpg = mpg) data_grid(mtcars, mpg = seq_range(mpg, 10)) # If you supply a model, missing predictors will be filled in with # typical values mod <- lm(mpg ~ wt + cyl + vs, data = mtcars) data_grid(mtcars, .model = mod) data_grid(mtcars, cyl = seq_range(cyl, 9), .model = mod) </pre> <hr /><div style="text-align: center;">[Package <em>modelr</em> version 0.1.8 <a href="00Index.html">Index</a>]</div> </body></html>