tabulate                package:base                R Documentation

_T_a_b_u_l_a_t_i_o_n _f_o_r _V_e_c_t_o_r_s

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

     'tabulate' takes the integer-valued vector 'bin' and counts the
     number of times each integer occurs in it.

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

     tabulate(bin, nbins = max(1, bin))

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

     bin: a numeric vector (of positive integers), or a factor.

   nbins: the number of bins to be used.

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

     'tabulate' is used as the basis of the 'table' function.

     If 'bin' is a factor, its internal integer representation is
     tabulated.

     If the elements of 'bin' are numeric but not integers, they are
     truncated to the nearest integer.

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

     An integer vector (without names).  There is a bin for each of the
     values '1, ..., nbins'; values outside that range are (silently)
     ignored.

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

     'table', 'factor'.

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

     tabulate(c(2,3,5))
     tabulate(c(2,3,3,5), nbins = 10)
     tabulate(c(-2,0,2,3,3,5))  # -2 and 0 are ignored
     tabulate(c(-2,0,2,3,3,5), nbins = 3)
     tabulate(factor(letters[1:10]))

