service.check_obligatory_params {kidney.epi} | R Documentation |
Check whether all obligatory paramenters of a given function are present.
service.check_obligatory_params(fx_params, args,
predefined_result = TRUE)
fx_params |
List. List of parameters required by function. |
args |
List. Arguments transferred to the function upon user call. |
predefined_result |
Logical. Required only in case if other checks were performed in the main script and the result of this check has to be processed to the function. For example, if in the parent script I've checked the presence of height parameter, and it is absent (while is obligatory), I transfer this info in the "predefined_result = FALSE", so in the function the fx_params_resulting become False and will lead to stop(). |
Check whether all obligatory paramenters of a given function are present.
Programming: Boris Bikbov boris@bikbov.ru.
Character string. Returns a messages and stops function if any of the obligatory parameters are absent.
# could be run only inside function wich receives some parameters
# fx_params <- c("creatinine", "age", "ethnicity", "sex")
# args <- names(as.list(match.call())[-1])
# service.check_obligatory_params(fx_params, args)