home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / base / approxfun < prev    next >
Encoding:
Text File  |  1997-04-23  |  1.3 KB  |  43 lines

  1.     
  2.     _L_i_n_e_a_r_l_y _I_n_t_e_r_p_o_l_a_t_i_n_g _F_u_n_c_t_i_o_n_s
  3.     
  4.          approxfun(x, y, method="linear", rule=1)
  5.     
  6.     _A_r_g_u_m_e_n_t_s:
  7.     
  8.              x,y : vectors giving the coordinates of the points
  9.                    to be interpolated.  Alternatively a single
  10.                    plotting structure can be specified.
  11.     
  12.             xout : an optional set of values specifying where
  13.                    interpolation is to take place.
  14.     
  15.           method : this specifies the interpolation method to be
  16.                    used.  Currently this is ignored and linear
  17.                    interpolation is always used.
  18.     
  19.             rule : an integer describing how interpolation is to
  20.                    take place outside the interval
  21.                    [min(x),max(x)].  If rule is 1 then NAs are
  22.                    returned for such points and if it is 2, the
  23.                    value at the closest data extreme is used.
  24.     
  25.     _V_a_l_u_e:
  26.     
  27.          A function which will perform linear interpolation of
  28.          the given data points.  For a given set of x values
  29.          this function will return the corresponding interpo-
  30.          lated values.  This is often more useful than approx.
  31.     
  32.     _S_e_e _A_l_s_o:
  33.     
  34.          approx, spline, splinefun.
  35.     
  36.     _E_x_a_m_p_l_e_s:
  37.     
  38.          x <- 1:10
  39.          y <- rnorm(10)
  40.          f <- approxfun(x, y)
  41.          curve(f(x), 0, 10)
  42.     
  43.