Re: [R] expand.grid using a repeated vector as a parameter

2008-05-02 Thread Greg Snow
Try: > tmp <- rep( list( 0:1 ), 5 ) > out <- do.call(expand.grid, tmp) Then change the 5 to whatever you want. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -Original Message- > From: [EMAIL PRO

Re: [R] expand.grid using a repeated vector as a parameter

2008-05-02 Thread Prof Brian Ripley
?do.call On Fri, 2 May 2008, Simon Parker wrote: Hello. I'm trying to do this (not necessarily 0:1) : expand.grid ( 0:1, 0:1, 0:1, 0:1, 0:1) etc..etc. but I want to have control over how many 0:1 are included. Any ideas please ? Thankyou. Simon Parker Imperial College -