peaks                package:simecol                R Documentation

_F_i_n_d _P_e_a_k_s _W_i_t_h_i_n _x_y-_D_a_t_a

_D_e_s_c_r_i_p_t_i_o_n:

     The function returns maxima (values which have only smaller
     neighbours) and minima (values which have only larger neighbours).

_U_s_a_g_e:

     peaks(x, y=NULL, mode="maxmin")

_A_r_g_u_m_e_n_t_s:

    x, y: the coordinates of given points.

    mode: specifies if both maxima and minima ('mode="maxmin"') or only
          maxima ('mode="max"') or minima ('mode="min"') are requested. 

_V_a_l_u_e:

     A list with x and y coordinates of all peaks.

_S_e_e _A_l_s_o:

     'approx', 'upca'

_E_x_a_m_p_l_e_s:

     x <- sin(seq(0, 10, 0.1))
     plot(x)
     points(peaks(x), col="red", pch=15)

