r lifecycle::badge("deprecated") Calls a function provided by the user and adds the function call to the error message if the call fails.
See also
Other deprecated:
date_source()
,
derive_param_extreme_record()
,
derive_var_dthcaus()
,
derive_var_extreme_dt()
,
derive_var_extreme_dtm()
,
dthcaus_source()
,
get_summary_records()
Examples
call_user_fun(compute_bmi(
height = 172,
weight = 60
))
#> `call_user_fun()` was deprecated in admiral 1.3.0.
#> ℹ `call_user_fun()` is no longer supported and no replacement is provided;
#> ℹ The original code for this function is here:
#> ℹ https://github.com/pharmaverse/admiral/blob/v1.2.0/R/call_user_fun.R#L26-L39
#> [1] 20.28123
try(call_user_fun(compute_bmi(
height = 172,
weight = "hallo"
)))
#> Error in call_user_fun(compute_bmi(height = 172, weight = "hallo")) :
#> Calling `compute_bmi(height = 172, weight = "hallo")` caused the
#> following error:
#> Argument `weight` must be a numeric vector, but it is a string.