interpSpline             package:splines             R Documentation

_C_r_e_a_t_e _a_n _I_n_t_e_r_p_o_l_a_t_i_o_n _S_p_l_i_n_e

_D_e_s_c_r_i_p_t_i_o_n:

     Create an interpolation spline, either from `x' and `y' vectors,
     or from a formula/data.frame combination.

_U_s_a_g_e:

     interpSpline(obj1, obj2, bSpline, period, na.action)

_A_r_g_u_m_e_n_t_s:

    obj1: Either a numeric vector of `x' values or a formula.

    obj2: If `obj1' is numeric this should be a numeric vector of the
          same length.  If `obj1' is a formula this can be an optional
          data frame in which to evaluate the names in the formula.

 bSpline: If `TRUE' the b-spline representation is returned, otherwise
          the piecewise polynomial representation is returned. Defaults
          to `FALSE'.

  period: An optional positive numeric value giving a period for a
          periodic interpolation spline.

na.action: a optional function which indicates what should happen when
          the data contain `NA's.  The default action (`na.omit') is to
          omit any incomplete observations.  The alternative action
          `na.fail' causes `interpSpline' to print an error message and
          terminate if there are any incomplete observations.

_V_a_l_u_e:

     An object that inherits from class `spline'. The object can be in
     the B-spline representation, in which case it will be of class
     `nbSpline' for natural B-spline, or in the piecewise polynomial
     representation, in which case it will be of class `npolySpline'.

_A_u_t_h_o_r(_s):

     Douglas Bates and Bill Venables

_S_e_e _A_l_s_o:

     `splineKnots', `splineOrder', `periodicSpline'

_E_x_a_m_p_l_e_s:

     library( splines )
     data( women )
     ispl <- interpSpline( women$height, women$weight )
     ispl2 <- interpSpline( weight ~ height,  women )
     # ispl and ispl2 should be the same
     plot( predict( ispl, seq( 55, 75, len = 51 ) ), type = "l" )
     points( women$height, women$weight )
     plot( ispl )    # plots over the range of the knots
     points( women$height, women$weight )
     splineKnots( ispl )

