Skip to contents

Weighted Sum

Usage

weighted.sum(x, w, na.rm = TRUE)

Arguments

x

a numeric vector of values

w

a numeric vector of weights

na.rm

a logical indicating whether to ignore NA values

Value

A numeric vector.

Examples

x <- 1:20
w <- runif(20)
weighted.sum(x, w)
#> [1] 114.4134