Learn R Programming

vismeteor (version 2.0.1)

freq.quantile: Quantiles with a minimum frequency

Description

This function generates quantiles with a minimum frequency. These quantiles are formed from a vector freq of frequencies. Each quantile then has the minimum total frequency min.

Usage

freq.quantile(freq, min)

Value

A factor of indices is returned. The index references the corresponding passed frequency freq.

Arguments

freq

integer; A vector of frequencies.

min

integer; Minimum total frequency per quantile.

Details

The frequencies freq are grouped in the order in which they are passed as a vector. The minimum min must be greater than 0.

Examples

Run this code
freq <- c(1,2,3,4,5,6,7,8,9)
cumsum(freq)
(f <- freq.quantile(freq, 10))
tapply(freq, f, sum)

Run the code above in your browser using DataLab