Displaying 1 result from an estimated 1 matches for "temp3880w".
2012 Jun 05
3
rowSums problem
...weights
data. I also have a data frame of temperatures at 48 grid points, which I
have also attached.
Now, all I need to do is multiply all of the rows of the temperature data
frame by the weights (element-wise), and sum across the columns.
However, when I try to use the most obvious approach,
temp3880W <- weight3880*temp[,(3:50)]
temp3880W <- rowsum(temp3880W)
I get the wrong result:
head(temp3880W)
1 2 3 4 5 6
-0.4904454 -1.2728543 -1.5360133 -0.2687030 62.3048012 6.2610305
I've only been successful by using a for loop wh...