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 / approx < prev    next >
Encoding:
Text File  |  1997-04-23  |  1.6 KB  |  51 lines

  1.     
  2.     _L_i_n_e_a_r _I_n_t_e_r_p_o_l_a_t_i_o_n
  3.     
  4.          approx(x, y, xout, method="linear", n=50, 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.                n : If xout is not specified, interpolation takes
  20.                    place at n equally spaced points spanning the
  21.                    interval [min(x),max(x)].
  22.     
  23.             rule : an integer describing how interpolation is to
  24.                    take place outside the interval
  25.                    [min(x),max(x)].  If rule is 1 then NAs are
  26.                    returned for such points and if it is 2, the
  27.                    value at the closest data extreme is used.
  28.     
  29.     _V_a_l_u_e:
  30.     
  31.          A list containing n x and y coordinates which linearly
  32.          interpolate the given data points.
  33.     
  34.          The function approxfun returns a function which will
  35.          perform linear interpolation of the given data points.
  36.          For a given set of x values this function will return
  37.          the corresponding interpolated values.  This is often
  38.          more useful than approx.
  39.     
  40.     _S_e_e _A_l_s_o:
  41.     
  42.          approxfun, spline, splinefun.
  43.     
  44.     _E_x_a_m_p_l_e_s:
  45.     
  46.          x <- 1:10
  47.          y <- rnorm(10)
  48.          plot(x, y)
  49.          points(approx(x, y))
  50.     
  51.