Quickly generate the cartesian product of a matrix

后端 未结 5 1955
隐瞒了意图╮
隐瞒了意图╮ 2021-02-09 04:34

Let\'s say I have a matrix x which contains 10 rows and 2 columns. I want to generate a new matrix M that contains each unique pair of rows from

5条回答
  •  死守一世寂寞
    2021-02-09 04:52

    You can also try the "relations" package. Here is the vignette. It should work like this:

    relation_table(x %><% x)
    

提交回复
热议问题