weighted.tabulate: Weighted Tabulation for Vectors

View source: R/weighted_quantile.R

weighted.tabulateR Documentation

Weighted Tabulation for Vectors

Description

weighted.tabulate() returns the sum of weights for each integer in the vector bin.

Usage

weighted.tabulate(bin, w = NULL, nbins = max(1L, bin, na.rm = TRUE))

Arguments

bin

a numeric vector of positive integers, or a factor.

w

a numeric vector of the sample weights for each value in bin.

nbins

the number of bins to be used.

Details

weighted.tabulate() is a wrapper function of tabulate() to reflect sample weights. This function is used in factor.encoder() to enable weights-based encoding.

Value

weighted.tabulate() returns a numeric vector.

See Also

weighted.quantile


midr documentation built on Sept. 11, 2025, 1:07 a.m.