Turned col- and rowWeightedMeans() into plain R functions