wtdTable {eatTools}R Documentation

Computed weighted frequency tables

Description

This functions works quite equally as the wtd.table function from the Hmisc package.

Usage

wtdTable(x , weights , na.rm = FALSE)

Arguments

x

a character or category or factor vector

weights

a numeric vector of non-negative weights

na.rm

set to FALSE to suppress checking for NAs. If TRUE, NAs are removed from x as well as from weights prior to variance estimation.

Value

a frequency table

Examples

x <- c(50, 1, 50)
w <- c(1, 4, 1)
wtdTable(x, w)

[Package eatTools version 0.7.6 Index]