Skip to content
Prev 246596 / 398506 Next

weighed mean of a data frame row-by-row

Em 6/1/2011 11:33, Vassilis escreveu:
Vassilis,

Is this what you're looking for?
 > test.df$y <- test.df$x1 * test.df$w + test.df$x2 * (1 - test.df$ w)
 > test.df$y
[1] 2.6 3.0 4.5

--
Cesar Rabak