Count Entries in Bins

DESCRIPTION:
Counts the number of occurrences of integers.

USAGE:
tabulate(bin, nbins = max(bin))

REQUIRED ARGUMENTS:
bin:
vector of bin numbers, between 1 and nbins, inclusive. A category is appropriate for bin. Missing values are not accepted.

OPTIONAL ARGUMENTS:
nbins:
maximum number of bins, at least as large as max(bin).

VALUE:
vector of length nbins. The ith element of the value counts the number of is that occurred in bin.

DETAILS:
Takes a vector, bin, and returns a vector of length nbins. For each element, i, counts the number of is that occurred in bin.

SEE ALSO:
category , hist , table .

EXAMPLES:
tabulate(cut(lottery.payoff,10),10)

x <- c(1,2,3,4,5,5,6,6,7,8) tabulate(x) [1] 1 1 1 1 2 2 1

tabulate(x,15) [1] 1 1 1 1 2 2 1 1 0 0 0 0 0 0 0