GetBinNumber         package:GraphAlignment         R Documentation

_G_e_t _b_i_n _n_u_m_b_e_r

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

     Get the bin number for the argument using the specified lookup
     vector.

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

     GetBinNumber(x, lookup, clamp=TRUE)

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

       x: value to be binned

  lookup: lookup vector

   clamp: clamp value to lookup range

_D_e_t_a_i_l_s:

     The lookup vector defines the lower and upper boundaries for each
     bin. The first entry in the lookup vector is the lower boundary of
     the first bin, while the last value in the lookup vector is the
     upper boundary of the last bin. For all other entries, entry i of
     the lookup vector defines the upper boundary of the (i-1)-th bin
     and the lower boundary of the i-th bin. The number of bins is
     therefore n-1, where n is the length of the lookup vector. A
     lookup vector must have at least two elements.

     If clamping is enabled (clamp=TRUE), arguments which fall below
     the lower boundary of the first bin are treated as if they are
     actually in the first bin. Likewise, values which are above the
     upper boundary of the last bin are treated as if they are actually
     in the last bin. If clamping is disabled (clamp=FALSE), values
     outside the lookup range cause an error.

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

     This function returns the bin number corresponding to the input
     value. The bin number is obtained by performing a lookup in the
     specified lookup vector.

_A_u_t_h_o_r(_s):

     Joern P. Meier, Michal Kolar, Ville Mustonen, Michael Laessig, and
     Johannes Berg

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

       lookup <- c(-1, 0, 1)
       GetBinNumber(-0.5, lookup)
       GetBinNumber(0.5, lookup)

