2017-10-16 36 views
0

我正在使用mclapply并行运行我的代码。以下是我的代码片段。当我设置mc.preschedule = FALSE时,它将存储错误并转到列表中的下一个项目。我想查看列表中的所有元素都有关联的错误消息。列出嵌套列表中包含错误消息的所有索引R

OutputList = mclapply(Users.list,TestFunction,mc.cores = 25,mc.preschedule = FALSE) 

下面是一个列表中的项目的错误消息。

`Jack` 
[1] "Error in TestFunction(DF, x) : \n Nodes in query cannot be found in the input graph.\n\n" 
attr(,"class") 
[1] "try-error" 
attr(,"condition") 
<simpleError in TestFunction(DF, x): Nodes in query cannot be found in the input graph. 

有没有办法可以列出所有包含错误信息的索引?

回答

0
which(mapply(inherits, OutputList, 'try-error'))