且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

中断/退出脚本

更新时间:2023-12-05 21:10:10

如果希望程序产生错误,则可以使用 stopifnot()函数:

You could use the stopifnot() function if you want the program to produce an error:

foo <- function(x) {
    stopifnot(x > 500)
    # rest of program
}