xyVector               package:splines               R Documentation

_C_o_n_s_t_r_u_c_t _a_n _x_y_V_e_c_t_o_r _O_b_j_e_c_t

_D_e_s_c_r_i_p_t_i_o_n:

     Create an object to represent a set of x-y pairs.  The resulting
     object can be treated as a matrix or as a data frame or as a
     vector. When treated as a vector it reduces to the 'y' component
     only.

     The result of functions such as 'predict.spline' is returned as an
     'xyVector' object so the x-values used to generate the y-positions
     are retained, say for purposes of generating plots.

_U_s_a_g_e:

     xyVector(x, y)

_A_r_g_u_m_e_n_t_s:

       x: a numeric vector

       y: a numeric vector of the same length as 'x'

_V_a_l_u_e:

     An object of class 'xyVector' with components 

       x: a numeric vector

       y: a numeric vector of the same length as 'x'

_A_u_t_h_o_r(_s):

     Douglas Bates and Bill Venables

_E_x_a_m_p_l_e_s:

     data( women )
     ispl <- interpSpline( weight ~ height, women )
     weights <- predict( ispl, seq( 55, 75, len = 51 ))
     class( weights )
     plot( weights, type = "l", xlab = "height", ylab = "weight" )
     points( women$height, women$weight )
     weights

