I want to calculate the weighted average for different columns in a data frame This is my data:
x.4 <- c(2,3,4,5) a.4 <- c(2,3,4,5) x.8 <- c(3,24,2,2) a.