Re: [R] yet another vectorization question

From: Adrian Dusa <adi_at_roda.ro>
Date: Tue 31 Jan 2006 - 05:09:55 EST

On Monday 30 January 2006 14:40, Philippe Grosjean wrote:
> Hello,
> Not exactly the same. By the way, why do you use do.call()? Couldn't you
> do simply:
> expand.grid(split(t(replicate(3, c(0, 1, NA))), 1:3))

Just for the sake of it, the above can be even more simple with:

expand.grid(lapply(1:3, function(x) c(0, 1, NA)))

Best,
Adrian

-- 
Adrian DUSA
Romanian Social Data Archive
1, Schitu Magureanu Bd
050025 Bucharest sector 5
Romania
Tel./Fax: +40 21 3126618 \
          +40 21 3120210 / int.101

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue Jan 31 05:43:57 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:15 EST