I have a variable with a similar structure to the following but with many more rows:
a=1 0.31 0.12 0.72 0.62 0.32 0.93 0.54 0.84 0.15 0.15 0.95 0.4
Say I want sums of column 2 with respect to each scalar (eg. 1, 2…5) so that I would get a new variable like this:
aa=1 0.42 2.53 0.54 0.95 1.4
I have not found how to sum anything but rows and columns, so how should I go about summing based on values within a variable?
Best Answer