Skip to content
Prev 377311 / 398502 Next

Identify row indices corresponding to each distinct row of a matrix

A mess -- due to your continued use of html formatting.

But something like this may do what you want (hard to tell with the mess):
[,1] [,2]
 [1,]    1    9
 [2,]    2   10
 [3,]    3   11
 [4,]    4   12
 [5,]    5   13
 [6,]    6   14
 [7,]    7   15
 [8,]    8   16
 [9,]    1    9
[10,]    2   10
[11,]    3   11
[12,]    4   12
[13,]    5   13
[14,]    6   14
[15,]    7   15
[16,]    8   16
vector
[1] "1-9"  "2-10" "3-11" "4-12" "5-13" "6-14" "7-15" "8-16" "1-9"  "2-10"
"3-11" "4-12" "5-13" "6-14"
[15] "7-15" "8-16"
$`1-9`
[1] 1 9

$`2-10`
[1]  2 10

$`3-11`
[1]  3 11

$`4-12`
[1]  4 12

$`5-13`
[1]  5 13

$`6-14`
[1]  6 14

$`7-15`
[1]  7 15

$`8-16`
[1]  8 16
There may well be slicker ways to do this -- if this is actually what you
want to do.

-- Bert
On Wed, Nov 7, 2018 at 7:56 PM li li <hannah.hlx at gmail.com> wrote: