R/f_operator.R

Defines functions f_operator

f_operator = function(f){
  new_f = function(x){
    if(x>0){
      f(x)
    }else{
      cnd = catch_cnd(rlang::abort(
        message = "invalid input",
        .subclass = "invalid_input",
        invalid_input = x))
    }
  }
  return(new_f)
}
Hung-Ching-Chang/biost2094_hw2 documentation built on March 19, 2022, 2:29 a.m.