weightedSum: Calculates weighted sum.

Description Usage Arguments See Also

View source: R/2statsHelpers.R

Description

Computes a weighted sum of a numeric vector.

Usage

1
  weightedSum(x, w, na.rm = TRUE)

Arguments

x

a numeric vector containing the values whose weighted sum is to be computed.

w

a vector of weights the same length as x giving the weights to use for each element of x. Negative weights are treated as zero weights. Default value is equal weight to all values.#

na.rm

a logical value indicating whether NA values in x should be stripped before the computation proceeds, or not. If NA, no check at all for NAs is done. Default value is NA (for efficiency).

See Also

as.surveyorStats

Other "central tendency functions": weightedCount, weightedMean, weightedMedian

Other stats helper functions: allNA, allNull, is.yesno, qType, reorderQuestion, reorderResponse, splitBinCombine, splitMeanCombine, splitPercentCombine, weightedCount, weightedMean, weightedMedian


andrie/surveyor documentation built on June 3, 2017, 7:04 p.m.