On 7/22/07, Dimitris Rizopoulos <Dimitris.Rizopoulos at med.kuleuven.be> wrote: > try this: > > x <- -3:3 > as.matrix(expand.grid(x, x)) > # or > t(as.matrix(expand.grid(x, x))) One minor shortening: t(expand.grid(x, x))