Movatterモバイル変換


[0]ホーム

URL:


rdrr.io

tabulate: Tabulation for Vectors

tabulateR Documentation

Tabulation for Vectors

Description

tabulate takes the integer-valued vectorbin and countsthe number of times each integer occurs in it.

Usage

tabulate(bin, nbins = max(1, bin, na.rm = TRUE))

Arguments

bin

a numeric vector (of positive integers), or a factor.Long vectors are supported.

nbins

the number of bins to be used.

Details

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.

Value

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.

See Also

table,factor.

Examples

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]))

What can we improve?

R Package Documentation

Browse R Packages

We want your feedback!

Note that we can't provide technical support on individual packages. You should contact the package authors for that.

 
Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, readEmbedding Snippets.

Close

[8]ページ先頭

©2009-2026 Movatter.jp