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 = FALSE, period = NULL,
                  na.action = na.fail)

_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:

     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 )

