I有一个大的数字矩阵(实际上是2000000 x 8000,但以下是一个较小的维度示例): 图书馆(dplyr) set.seed(1) 垫子

问题描述 投票:0回答:0

它有几个元素

NA
NaN

Inf
na.idx <- sample(2500000, 300, replace = F)
mat[na.idx[1:100]] <- NaN
mat[na.idx[101:200]] <- NA
mat[na.idx[201:300]] <- Inf

行分配给两种类型的组:
a

b

,因此(两种类型的)每组都映射到
mat
中的几行。
row.df <- data.frame(row.id = paste0("r",1:25000), group = c(paste0("a",sample(800, 20000, replace = T)), rep("b", 5000)))

对于每个唯一组
a
类型(因此,

a1

a800
),我需要运行the(
Anderson-Darling k-Sample Test
函数,来自the the the the the the the the the the the the the the the the the the Pockage),对于
ad.test
中的每一列,在映射到该特定组类型的行和映射到组的行中的行之间,我需要在删除该功能之前删除该功能之前,我需要删除该函数,因为它没有一个函数,因为它的参数是om gript grimat。
对于每个这样的对于每个这样的
R
i构建一个单行数据框,该框架指示
kSamples
ID,
mat
列ID以及
a
的统计量和p值。
这样做的方法是:
b
对于我拥有的真正的
NA
尺寸非常慢。
任何建议如何更快地运行它? 我已经在HPC群集上的多个计算节点上分配了它,但是它仍然太慢了。
	

与双子座进行几轮之后,这是一个更快的解决方案:

NaN
	
r matrix vector operation
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.