integer.frequency {plotrix}R Documentation

Calculate frequencies of a vector of integers

Description

Calculates the frequencies of integers in a vector.

Usage

 integer.frequency(x,bins)

Arguments

x a vector of integers.
bins The values to count in x. These values may be a subset or superset of the actual values included in x.

Details

integer.frequency counts the number of values in x that are equal to each of the values in bins. If there are values in bins that are not in x, the count for that bin will be zero, and if values in x are not included in bins, they will be ignored. It will not handle NAs correctly. However, it is only meant to be called by freq.

Value

A vector of counts.

Author(s)

Jim Lemon

See Also

freq

Examples

 testvec<-c(sample(1:10,100,TRUE),rep(12,5))
 # leave out the 10 bin and stick in an 11 bin which will be empty
 integer.frequency(testvec,c(1:9,11,12))

[Package plotrix version 2.0.2 Index]