check.args_: Check string arguments

View source: R/check_args.R

check.args_R Documentation

Check string arguments

Description

Check string arguments

Usage

check.args_(
  data_ = NULL,
  mandatory_ = FALSE,
  arg_ = NULL,
  class_ = NULL,
  class.action_ = NULL,
  mutate_ = NULL,
  message_ = message
)

Arguments

data_

Data to be checked.

mandatory_

If the argument is mandatory for the analysis.

arg_

The string with the name of the function argument (e.g., "gen").

class_

The expected class of the variable in data.

class.action_

The action to be taken if the variable has the wrong class (e.g., "message", "warning", "stop").

mutate_

If the argument should be mutated into the desired class.

message_

If class.action_ == "message", write message = "message" to capture upstream message command.

Details

This functions uses the get and assign which are need access to objects that are one environment up on the hierarchy. The envir is set to parent.frame. If the function is looking for something two or more environments up, the arguments of parent.frame have to be changed.


ASRgenomics documentation built on May 29, 2024, 12:03 p.m.