R/weighted_sum.R
weighted.sum.Rd
Weighted Sum
weighted.sum(x, w, na.rm = TRUE)
a numeric vector of values
a numeric vector of weights
a logical indicating whether to ignore NA values
NA
A numeric vector.
x <- 1:20 w <- runif(20) weighted.sum(x, w) #> [1] 114.4134