Re: [R] outer() problem

2014-05-01 Thread David Winsemius
On Apr 30, 2014, at 11:44 PM, Marc Girondot wrote: > Dear list-members, > > Can someone explains me why the last command gives an error. Thanks a lot: > > outer(0:1, 0:1, FUN=function(x, y) {x+y}) > [,1] [,2] > [1,]01 > [2,]12 > > outer(0:1, 0:1, FUN=function(x, y) {x}) >

Re: [R] outer() problem

2014-05-01 Thread Berend Hasselman
On 01-05-2014, at 08:44, Marc Girondot wrote: > Dear list-members, > > Can someone explains me why the last command gives an error. Thanks a lot: > > outer(0:1, 0:1, FUN=function(x, y) {x+y}) > [,1] [,2] > [1,]01 > [2,]12 > > outer(0:1, 0:1, FUN=function(x, y) {x}) > [,1

Re: [R] outer() problem

2014-05-01 Thread Ken Knoblauch
Marc Girondot yahoo.fr> writes: > > outer(0:1, 0:1, FUN=function(x, y) {1}) > Erreur dans outer(0:1, 0:1, FUN = function(x, y) { : >dims [produit 4] ne correspond pas à la longueur de l'objet [1] Because whatever the dimensions of your 2 input vectors, this function simply returns the value