Ok so I am writing a larger function that call a few functions.
The issue is that I need to break out of "function_inner" under certain logical conditions without breaking out of "function_outer". Break seems to work for loops, and stop, well it stops all functions... any ideas?
function_outer <- function(){
beta =1
function_inner <- function(beta){
if (beta==1){?break?stop}
print("Its not working")
}
return(beta)
}
Do you mean to return
a value?
function_outer <- function(){
beta =1
function_inner <- function(beta){
if (beta==1){ return("Inner beta is 1") }
print("Its not working")
}
return(beta)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With