Displaying 2 results from an estimated 2 matches for "philozin".
Did you mean:
philozine
2008 Dec 03
1
Create unique sets of 3 from a vector of IDs?
Dear all:
This is one of those "should be easy" problems that I'm having great difficulty solving. I have a vector containing ID codes, and I need to generate a 3-column matrix that contains all possible combinations of three.
For example, my ID vector looks like this:
A
B
C
D
E
I need to generate a matrix that looks like this:
A B C
A B D
A B E
A C B
A C D
A C E
A D B
A D C
A D E
2007 Jun 14
3
Retain names in conversion of matrix to vector
Hi R-listers,
I'm using R only for a few basic functions but am having difficulty doing something that *should* be simple. I have an nxn matrix, Q, where Q[i,j] is a directed value (in this case, oil exports from i to j). Note that Q[i,j]~=Q[j,i]. I imported column names along with the matrix then copied them to the rows using rownames(Q) <- colnames(Q). Simple so far.
What I'd like