Hi.
I want to get a series data just like this:
sp1 sp2
1   2
1   3
1   4
1   5
2   3
2   4
2   5
3   4
3   5
4   5

I can get one part of the data every time, but I can get the data directly.
I try to use the loop, but it can not work. How to get it ? Thanks.

pair.fn=function(i,sp=5){res=data.frame(sp1=rep(i,(sp-i)),sp2=(i+1):sp)
return(res)}
pair.fn(1)
pair.fn(2)
.....

	[[alternative HTML version deleted]]

