Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
linux上带R的多核处理_R_Linux_Parallel Processing_Multicore - Fatal编程技术网

linux上带R的多核处理

linux上带R的多核处理,r,linux,parallel-processing,multicore,R,Linux,Parallel Processing,Multicore,我正试图使用R软件包pegas所涉及的程序进行Hardy Weinberg精确测试。我编写的代码对54个总体中的每一个应用了10^5个排列的测试,然后将p值结果写入单粒子矩阵。我使用for循环,使用下面的代码,一次一个地将该过程自动应用于所有54个POP for(M in 1:nPop(cod)) { hw.result <- hw.test(cod[pop=M], B = 100000)# Carry out hw test on pop M HWE.matrix[,M] <- h

我正试图使用R软件包pegas所涉及的程序进行Hardy Weinberg精确测试。我编写的代码对54个总体中的每一个应用了10^5个排列的测试,然后将p值结果写入单粒子矩阵。我使用for循环,使用下面的代码,一次一个地将该过程自动应用于所有54个POP

for(M in 1:nPop(cod))
{
hw.result <- hw.test(cod[pop=M], B = 100000)# Carry out hw test on pop M
HWE.matrix[,M] <- hw.result[,"Pr.exact"]# Feed results into the matrix
}
for(M/1:nPop(cod))
{

hw.result您是否阅读了安装R附带的“parallel”软件包的小插曲?我已经阅读了,因此掌握了集群的制作。我不完全理解它,并且很难确定哪些部分与我相关。我尝试了一些部分,但没有用。
 foreach(i in 1:nPop(cod)) %dopar%
{
hw.result <- hw.test(cod[pop=i], B = 100000)# Carry out hw test on pop M
HWE.matrix[,i] <- hw.result[,"Pr.exact"]# Feed results into the matrix
}