dot-validate_fns: Check that functions have correct parameters

Description Usage Arguments Examples

Description

Each function supplied to run_gamlss_pipeline must have certain parameters. They alaways include params_dots.

Usage

1
.validate_fns(env, expected_params = NULL)

Arguments

env

environment. Environment in which the functions are found and to be saved.

expected_params

list. Names are names of functions to be validated and values are expected parameters. If NULL, then a default list is used. Run body(gamlsspipeline:::.validate_fns) to see default. Default is NULL.

Examples

1
2
3
4
5
6
env_curr <- environment()
fn1 <- function(x) x; fn2 <- function(x) y
expected_params <- list(fn1 = 'x', fn2 = 'y')
gamlsspipeline:::.validate_fns(env = env_curr, expected_params = expected_params) # error
fn2 <- NULL
gamlsspipeline:::.validate_fns(env = env_curr, expected_params = expected_params) # no error given if fn is NULL

MiguelRodo/gamlsspipeline documentation built on July 25, 2020, 7:23 p.m.