Re: [Rd] outer not applying a constant function

2017-03-21 Thread Martin Maechler
> William Dunlap > on Mon, 20 Mar 2017 10:20:11 -0700 writes: >> Or is this a bad idea? > I don't like the proposal. I have seen code like the following (in > fact, I have written such code, where I had forgotten a function was > not vectorized)

Re: [Rd] outer not applying a constant function

2017-03-20 Thread William Dunlap via R-devel
> Or is this a bad idea? I don't like the proposal. I have seen code like the following (in fact, I have written such code, where I had forgotten a function was not vectorized) where the error would have been discovered much later if outer() didn't catch it. > outer(1:3, 11:13, sum) Error

Re: [Rd] outer not applying a constant function

2017-03-20 Thread Martin Maechler
> Gebhardt, Albrecht > on Sun, 19 Mar 2017 09:14:56 + writes: > Hi, > the function outer can not apply a constant function as in the last line of the following example: >> xg <- 1:4 >> yg <- 1:4 >> fxyg <- outer(xg, yg,

[Rd] outer not applying a constant function

2017-03-19 Thread Gebhardt, Albrecht
Hi, the function outer can not apply a constant function as in the last line of the following example: > xg <- 1:4 > yg <- 1:4 > fxyg <- outer(xg, yg, function(x,y) x*y) > fconstg <- outer(xg, yg, function(x,y) 1.0) Error in outer(xg, yg, function(x, y) 1) : dims [product 16] do not match the