【问题标题】:Error in mclapply(., function(x) { : 'mc.cores' > 1 is not supported on Windowsmclapply(., function(x) { : \'mc.cores\' > 1 中的错误在 Windows 上不受支持
【发布时间】:2022-08-04 16:47:31
【问题描述】:

如何在 Windows 中使用这条线?

mclapply(.,
           function(x) {filter_taxa(x, function(y) sum(y) > 0, TRUE)},
           mc.cores = nrow(params_2)) -> # remove 0-summed ASVs
  Ps_obj_SIP_each_rep_l```

I need to replace mclapply and mc.cores to a proper function in windows. 

    标签: r


    【解决方案1】:

    mclapply() 与 lapply 相同,但在多个内核上。因此,要重构它以使其在没有并行化的情况下工作,只需试试这个;

    lapply(., function(x) {filter_taxa(x, function(y) sum(y) > 0, TRUE)})
    

    mclapply docs 中查看更多信息:

    mclapplylapply 的并行版本,

    【讨论】:

      猜你喜欢
      • 2018-03-02
      • 1970-01-01
      • 1970-01-01
      • 2017-08-03
      • 2014-06-07
      • 2022-12-22
      • 1970-01-01
      • 2023-03-11
      • 1970-01-01
      相关资源
      最近更新 更多