Stop an R program without error

前端 未结 9 1597
执笔经年
执笔经年 2020-12-01 10:35

Is there any way to stop an R program without error?

For example I have a big source, defining several functions and after it there are some calls to the functions.

9条回答
  •  离开以前
    2020-12-01 11:34

    why not just use an if () {} else {}? It's only a couple of characters...

    f1 <- function(){}
    f2 <- function(){}
    
    if (justUpdate) {
    } else {
    # main body 
    }
    

    or even

    f1 <- function(){}
    f2 <- function(){}
    
    if (!justUpdate) {
    # main body 
    }
    

提交回复
热议问题