dots_to_fun_args: Helper function to process ... args to pass to multiple...

View source: R/dgp-lib-utils.R

dots_to_fun_argsR Documentation

Helper function to process ... args to pass to multiple functions.

Description

Helper function to process ... args to pass to multiple functions.

Usage

dots_to_fun_args(
  prefix = c("X", "U", "y", "err", "betas", "betas_unobs", "betas_corr",
    "betas_uncorr"),
  ...
)

Arguments

prefix

Character vector of arbitrary prefixes to use in splitting entries of .... For example, if .X_p and .U_p are in ..., then this vector should include "X" and "U" so that this function will look for arguments with name prefixed by ".X_" and ".U_".

...

Named arguments to process.

Value

A list with ".optional_args" as well as entries named like ".X_args". For example, when "X" is one of the elements of the input character vector prefix and .X_p = 1 and .X_s = 2 are both passed via ..., the ".X_args" entry of the output list will be codelist(p = 1, s = 2). With the default value of prefix, the output list will the following have entries:

.X_args

Args to pass to function that generates X.

.U_args

Args to pass to function that generates U.

.y_args

Args to pass to function that generates y.

.err_args

Args to pass to function that generates err.

.betas_args

Args to pass to function that generates betas.

.betas_unobs_args

Args to pass to function that generates betas_unobs.

.betas_corr_args

Args to pass to function that generates betas_corr.

.betas_uncorr_args

Args to pass to function that generates betas_uncorr.

.optional_args

Args to pass optionally to all functions.


Yu-Group/dgpoix documentation built on June 3, 2022, 1:40 a.m.