Skip to content
Prev 302715 / 398502 Next

Outer product from matrix by row and a vector

On Aug 7, 2012, at 11:26 PM, Petr Savicky wrote:

            
That is not what result equals (as Petr illustrates.)
It's also the case that the printed result is just the transpose of  
what I earlier offered as a possible implementation of the OP's pseudo- 
code.:

 > identical( t( apply(a, 1, function(x) { x[1] + x[3]/ b } ) ), result)
[1] TRUE