home *** CD-ROM | disk | FTP | other *** search
-
- _L_i_n_e_a_r _I_n_t_e_r_p_o_l_a_t_i_o_n
-
- approx(x, y, xout, method="linear", n=50, rule=1)
-
- _A_r_g_u_m_e_n_t_s:
-
- x,y : vectors giving the coordinates of the points
- to be interpolated. Alternatively a single
- plotting structure can be specified.
-
- xout : an optional set of values specifying where
- interpolation is to take place.
-
- method : this specifies the interpolation method to be
- used. Currently this is ignored and linear
- interpolation is always used.
-
- n : If xout is not specified, interpolation takes
- place at n equally spaced points spanning the
- interval [min(x),max(x)].
-
- rule : an integer describing how interpolation is to
- take place outside the interval
- [min(x),max(x)]. If rule is 1 then NAs are
- returned for such points and if it is 2, the
- value at the closest data extreme is used.
-
- _V_a_l_u_e:
-
- A list containing n x and y coordinates which linearly
- interpolate the given data points.
-
- The function approxfun returns a function which will
- perform linear interpolation of the given data points.
- For a given set of x values this function will return
- the corresponding interpolated values. This is often
- more useful than approx.
-
- _S_e_e _A_l_s_o:
-
- approxfun, spline, splinefun.
-
- _E_x_a_m_p_l_e_s:
-
- x <- 1:10
- y <- rnorm(10)
- plot(x, y)
- points(approx(x, y))
-
-