awk '{arr[$1]=arr[$1] " " $2}END{for( i in arr){print i,arr[i]}}' edgelist.txt | sort -k1
On Fri, Dec 10, 2010 at 4:20 PM, profaar <prof...@live.com> wrote: > 1 2 > 1 3 > 1 4 > 1 5 > 2 3 > 2 4 > 3 2 > 4 1 > 4 3 > 4 5 > 5 2 > 5 4 ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.