The tabulate function takes as input a positive integer valued vector (e.g., x) and returns a vector that has length equal to n=maximum value in x, where the i-th entry is the number of times x contains the number i.
In the example below, the maximum element in x is 7, so the length of the output is 7. We interpret the output as telling us that x contains 0 1's, 2 2's, 0 3's, 5 4's, 0 5's, 1 6, and 2 7's.
> x <- c(2,4,2,6,4,7,7,4,4,4) > tabulate(x) [1] 0 2 0 5 0 1 2