问题描述
有没有人在R中有异常处理的示例/教程?官方文件非常简洁。除了Shane的回答指向您的其他StackOverflow讨论,您可以尝试一个代码搜索功能。 Google的代码搜索指出的原始答案已经被停用,但您可以尝试
- Github搜索在 ;
- Ohloh / Blackduck代码搜索例如
只是为了记录,还有尝试
但 tryCatch
可能是最好的。我尝试了Google Code Search的快速计算,但是尝试为动词本身提供太多的假阳性 - 但是似乎 tryCatch
被广泛使用。
Does anyone have examples/tutorials of exception handling in R? The official documentation is very terse.
Besides Shane's answer pointing you to other StackOverflow discussions, you could try a code search feature. This original answer pointed to Google's Code Search has since been discontinued, but you can try
- Github search as e.g. in this query for tryCatch in language=R;
- Ohloh/Blackduck Code search eg this query for tryCatch in R files
- the Debian code search engine on top of the whole Debian archive
Just for the record, there is also try
but tryCatch
may be preferable. I tried a quick count at Google Code Search but try gets too many false positives for the verb itself -- yet it seems tryCatch
is more widely used.
这篇关于R中的异常处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!