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