Re: [R] Conditional expand.grid()

2009-07-11 Thread Hesen Peng
Ah, that's exactly what I'm looking for. Thanks a lot. On Sat, Jul 11, 2009 at 11:23 AM, jim holtman wrote: > ?combn > >> combn(10,2) >     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] > [,13] [,14] [,15] [,16] [,17] > [1,]    1    1    1    1    1    1    1    1    1     2  

Re: [R] Conditional expand.grid()

2009-07-11 Thread jim holtman
?combn > combn(10,2) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [1,]111111111 2 2 2 2 2 2 2 2 [2,]23456789 10 3 4 5 6 7 8

[R] Conditional expand.grid()

2009-07-11 Thread Hesen Peng
Hello my R buddies, I'm trying to generate a bivariate data.frame with the elements of first row greater than the second row. The more complicated method that I can think of is: n <- 10 temp <- expand.grid(1:n,1:n) temp<-temp[temp[,1]>temp[,2],] However, I guess there must be some easie