freq.table: Frequency Table of Integers in a Vector

View source: R/freq.table.R

freq.tableR Documentation

Frequency Table of Integers in a Vector

Description

freq.table is used to obtain a frequency table of values from a numeric vector. Unlike table it includes the frequency of each integer value on the interval from the smallest to the largest observed value, and thus can contain also zeros.

Usage

	freq.table(x)

Arguments

x

a numeric vector.

Details

freq.table first coerces the input vector into type integer and then creates a table of frequencies of all integers on the closed interval from the smallest to the largest inputed integer.

Value

A named vector of frequencies.

Author(s)

Juraj Medzihorsky

See Also

table

Examples

	set.seed(1989)
	y <- c(rpois(1e1, 3), rpois(1e1, 1e1))
	freq.table(y)	
	#	compare with table()
	table(y)

jmedzihorsky/pistar documentation built on June 4, 2022, 9:58 a.m.