powered by
Exit from a Parent Function
exit_from_parent_function( n = 1, silent = FALSE, message = "Exiting from a parent function" )
the number of generations to go back (default = 1)
logical. If silent = TRUE, a message will be printed.
silent = TRUE
message to print
fn1 <- function() { print(1) print(2) } fn1() fn2 <- function() { print(1) exit_from_parent_function() print(2) } fn2()
Run the code above in your browser using DataLab