service.check_obligatory_params: Check whether all obligatory paramenters of a given function...

Description Usage Arguments Details Value Examples

View source: R/service.general.R

Description

Check whether all obligatory paramenters of a given function are present.

Usage

1
2
service.check_obligatory_params(fx_params, args,
  predefined_result = TRUE)

Arguments

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().

Details

Check whether all obligatory paramenters of a given function are present.

Programming: Boris Bikbov boris@bikbov.ru.

Value

Character string. Returns a messages and stops function if any of the obligatory parameters are absent.

Examples

1
2
3
4
# 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)

kidney.epi documentation built on March 13, 2020, 3:16 a.m.