EVOLUTION-MANAGER
Edit File: interpSpline.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 an Interpolation Spline</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 interpSpline {splines}"><tr><td>interpSpline {splines}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Create an Interpolation Spline</h2> <h3>Description</h3> <p>Create an interpolation spline, either from <code>x</code> and <code>y</code> vectors (<code>default</code> method), or from a <code>formula</code> / <code>data.frame</code> combination (<code>formula</code> method). </p> <h3>Usage</h3> <pre> interpSpline(obj1, obj2, bSpline = FALSE, period = NULL, ord = 4L, na.action = na.fail, sparse = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>obj1</code></td> <td> <p>either a numeric vector of <code>x</code> values or a formula.</p> </td></tr> <tr valign="top"><td><code>obj2</code></td> <td> <p>if <code>obj1</code> is numeric this should be a numeric vector of the same length. If <code>obj1</code> is a formula this can be an optional data frame in which to evaluate the names in the formula.</p> </td></tr> <tr valign="top"><td><code>bSpline</code></td> <td> <p>if <code>TRUE</code> the b-spline representation is returned, otherwise the piecewise polynomial representation is returned. Defaults to <code>FALSE</code>.</p> </td></tr> <tr valign="top"><td><code>period</code></td> <td> <p>an optional positive numeric value giving a period for a periodic interpolation spline.</p> </td></tr> <tr valign="top"><td><code>ord</code></td> <td> <p>an integer specifying the spline <em>order</em>, the number of coefficients per interval. <i>ord = d+1</i> where <i>d</i> is the <em>degree</em> polynomial degree. Currently, only cubic splines (<code>ord = 4</code>) are implemented.</p> </td></tr> <tr valign="top"><td><code>na.action</code></td> <td> <p>a optional function which indicates what should happen when the data contain <code>NA</code>s. The default action (<code>na.omit</code>) is to omit any incomplete observations. The alternative action <code>na.fail</code> causes <code>interpSpline</code> to print an error message and terminate if there are any incomplete observations.</p> </td></tr> <tr valign="top"><td><code>sparse</code></td> <td> <p>logical passed to the underlying <code><a href="splineDesign.html">splineDesign</a></code>. If true, saves memory and is faster when there are more than a few hundred points.</p> </td></tr> </table> <h3>Value</h3> <p>An object that inherits from (S3) class <code>spline</code>. The object can be in the B-spline representation, in which case it will be of class <code>nbSpline</code> for natural B-spline, or in the piecewise polynomial representation, in which case it will be of class <code>npolySpline</code>. </p> <h3>Author(s)</h3> <p>Douglas Bates and Bill Venables</p> <h3>See Also</h3> <p><code><a href="splineKnots.html">splineKnots</a></code>, <code><a href="splineOrder.html">splineOrder</a></code>, <code><a href="periodicSpline.html">periodicSpline</a></code>. </p> <h3>Examples</h3> <pre> require(graphics); require(stats) ispl <- interpSpline( women$height, women$weight ) ispl2 <- interpSpline( weight ~ height, women ) # ispl and ispl2 should be the same plot( predict( ispl, seq( 55, 75, length.out = 51 ) ), type = "l" ) points( women$height, women$weight ) plot( ispl ) # plots over the range of the knots points( women$height, women$weight ) splineKnots( ispl ) </pre> <hr /><div style="text-align: center;">[Package <em>splines</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>