相关疑难解决方法(0)

删除重复组合(无论顺序如何)

我有一个整数数据帧,它是1 ... n的所有n选择3组合的子集.例如,对于n = 5,它类似于:

      [,1] [,2] [,3]
 [1,]    1    2    3
 [2,]    1    2    4
 [3,]    1    2    5
 [4,]    1    3    4
 [5,]    1    3    5
 [6,]    1    4    5
 [7,]    2    1    3
 [8,]    2    1    4
 [9,]    2    1    5
[10,]    2    3    4
[11,]    2    3    5
[12,]    2    4    5
[13,]    3    1    2
[14,]    3    1    4
[15,]    3    1    5
[16,]    3    2    4
[17,]    3    2    5
[18,]    3    4    5 …
Run Code Online (Sandbox Code Playgroud)

combinations r

14
推荐指数
1
解决办法
4573
查看次数

从矩阵中的每一列中获取Min的最快方法是什么?

从矩阵中的每列中提取min的最快方法是什么?


编辑:

将所有基准移至下面的答案.

使用高,短或宽矩阵:

  ##  TEST DATA
  set.seed(1)
  matrix.inputs <- list(
        "Square Matrix"     = matrix(sample(seq(1e6), 4^2*1e4, T), ncol=400),   #  400 x  400
        "Tall Matrix"       = matrix(sample(seq(1e6), 4^2*1e4, T), nrow=4000),  # 4000 x   40
        "Wide-short Matrix" = matrix(sample(seq(1e6), 4^2*1e4, T), ncol=4000),  #   40 x 4000
        "Wide-tall Matrix"  = matrix(sample(seq(1e6), 4^2*1e5, T), ncol=4000),   #  400 x 4000
        "Tiny Sq Matrix"    = matrix(sample(seq(1e6), 4^2*1e2, T), ncol=40)     #   40 x   40
  )
Run Code Online (Sandbox Code Playgroud)

benchmarking r matrix min

12
推荐指数
3
解决办法
7311
查看次数

标签 统计

r ×2

benchmarking ×1

combinations ×1

matrix ×1

min ×1