Top "Weighted" questions

Fastest way to take the weighted sum of the columns of a matrix in R

I need the weighted sum of each column of a matrix. data <- matrix(1:2e7,1e7,2) # warning large number, …

r sum weighted