[R] changing the form of a list

jimi adams imij at columbus.rr.com
Mon Apr 8 17:12:56 CEST 2002


i have a 2 x n matrix that is a paired list of connections, i am working
with that looks something like:
1 2
1 3
1 5
2 1
2 3
3 1
3 2
4 5
5 1
5 4
for later operations it would be helpful if i could change this into the
form of:
1  2 3 5
2  1 3
3  1 2
4  5
5  1 4
the initial list is randomly generated and the max number of times that any
one number can appear is previoulsy defined by a limiting function (which is
variable depending on the numbers involved)
is there a clean way to change the form of that list?
i could do it with some big nasty if loops, but i was hoping that there
might be a quick generic way to do it that i am missing.
jimi adams
Department of Sociology
The Ohio State University
300 Bricker Hall
190 N Oval Mall
Columbus, OH 43210-1353
614-688-4261

our mind has a remarkable ability to think of contents as being independent
of the act of thinking
                                            -georg simmel


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list