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.
Just return something at the line you want to quit the function:
return
f <- function(x, dry=F) { message("hi1") if (dry) return(x) message("hi2") x <- 2*x } y1 <- f(2) # = 4 hi1 hi2 y2 <- f(2, dry=T) # = 2 hi1