search for: aplusb

Displaying 1 result from an estimated 1 matches for "aplusb".

Did you mean: aplus
2009 Sep 08
5
sparse vectors
...able to 'add' two such vectors. Toy problem follows. Suppose I have two such objects, 'a' and 'b': > a $index [1] 20 30 100000000 $val [1] 2.2 3.3 4.4 > b $index [1] 3 30 $val [1] 0.1 0.1 > What I want is the "sum" of these: > AplusB $index [1] 3 20 30 100000000 $val [1] 0.1 2.2 3.4 4.4 > See how the value for index=30 (being common to both) is 3.4 (=3.3+0.1). What's the best R idiom to achieve this? -- Robin K. S. Hankin Uncertainty Analyst University of Cambridge 19 Silver Street Cambridge CB3 9EP 01...