break/exit script

前端 未结 8 1417
Happy的楠姐
Happy的楠姐 2021-01-30 15:22

I have a program that does some data analysis and is a few hundred lines long.

Very early on in the program, I want to do some quality control and if there is not enou

8条回答
  •  别跟我提以往
    2021-01-30 16:12

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

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

提交回复
热议问题