在R中的数组中获取最大尺寸
我当前正在使用R中尺寸为5663x1000x100的非常大的数组。我想获得100个最大值,这将是每个5663x1000矩阵的最大值。
big_array = array(data=rnorm(566300000),dim=c(5663,1000,100))
到目前为止,我尝试过的两种方法包括for循环和apply(直觉上不应是最快的方法)。
maximas = rep(0,100)
# Method 1 - Runs in 17 seconds
for(i in seq(1,100)){
m...