weightedSum: Calculates weighted sum.

Description Usage Arguments See Also

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 May 10, 2019, 11:21 a.m.