Handle function arguments passed in the form of a data.frame

handle_df_args(
  df,
  exclude = NULL,
  parent_fn = NULL,
  fuzzy_match = TRUE,
  fn_env = NULL,
  ...
)

Arguments

df

data.frame with colnames() that should be applied to function arguments defined by parent_fn; or a character filename that contains delimited data that can be coerced to a data.frame, for example a tab-delimited or comma-delimited text file.

parent_fn

function used to obtain the formals() to define function arguments.

...

additional arguments are ignored.

Value

environment containing variables parsed from df

Details

This function is an internal utility function intended to allow funtion arguments to be passed as a single data.frame, and each of the colnames(df) represent formal function arguments.

One tricky aspect is how to handle arguments that only expect one value. It could be validated here, or that could be responsibility of the parent function.

Examples

parent_fn <- nmatlist2heatmaps;