| tabulate | R Documentation |
tabulate takes the integer-valued vectorbin and countsthe number of times each integer occurs in it.
tabulate(bin, nbins = max(1, bin, na.rm = TRUE))
bin | a numeric vector (of positive integers), or a factor.Long vectors are supported. |
nbins | the number of bins to be used. |
tabulate is the workhorse for thetable function.
Ifbin is a factor, its internal integer representationis tabulated.
If the elements ofbin are numeric but not integers,they are truncated byas.integer.
An integer valuedinteger ordouble vector(without names). There is a bin for each of the values1, ..., nbins; values outside that range andNAs are (silently)ignored.
On 64-bit platformsbin can have2^31 or moreelements (i.e.,length(bin) > .Machine$integer.max), and hencea count could exceed the maximum integer. For this reason, the returnvalue is of type double for such longbin vectors.
table,factor.
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 ignoredtabulate(c(-2,0,2,3,3,5), nbins = 3)tabulate(factor(letters[1:10]))
Add the following code to your website.
For more information on customizing the embed code, readEmbedding Snippets.
