[R] create an array with rep

Gabor Grothendieck ggrothendieck at gmail.com
Sun Jul 22 13:56:31 CEST 2007


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))



More information about the R-help mailing list