小编thu*_*oom的帖子

在R中使用mclapply抑制警告

随着mclapply()所有发出的警告似乎得到抑制:

library(multicore) 
mclapply(1:3, function(x) warning(x))
[[1]]
[1] "1"

[[2]]
[1] "2"

[[3]]
[1] "3"
Run Code Online (Sandbox Code Playgroud)

同时lapply会给:

lapply(1:3, function(x) warning(x))
[[1]]
[1] "1"

[[2]]
[1] "2"

[[3]]
[1] "3"

Warning messages:
1: In FUN(1:3[[3L]], ...) : 1
2: In FUN(1:3[[3L]], ...) : 2
3: In FUN(1:3[[3L]], ...) : 3
Run Code Online (Sandbox Code Playgroud)

有关如何避免丢失警告的任何提示?

warnings r mclapply

8
推荐指数
1
解决办法
575
查看次数

标签 统计

mclapply ×1

r ×1

warnings ×1