Skip to content
Prev 70497 / 398525 Next

define matrix by outer?

On 5/26/05, Zhen Pang <nusbj at hotmail.com> wrote:
Check out ?outer where it mentions that the function must be
able to handle vector arguments.  Yours does not but you can
transform it to one which does using mapply:

outer(1:k, 1:k, function(x,y) mapply(mn, x, y))