enve.cliopts: Enveomics: Cliopts

View source: R/cliopts.R

enve.clioptsR Documentation

Enveomics: Cliopts

Description

Generates nicely formatted command-line interfaces for functions (closures only).

Usage

enve.cliopts(
  fx,
  rd_file,
  positional_arguments,
  usage,
  mandatory = c(),
  vectorize = c(),
  ignore = c(),
  number = c(),
  defaults = list(),
  o_desc = list(),
  p_desc = ""
)

Arguments

fx

Function for which the interface should be generated.

rd_file

(Optional) .Rd file with the standard documentation of the function.

positional_arguments

(Optional) Number of positional arguments passed to parse_args (package: optparse).

usage

(Optional) Usage passed to OptionParser (package: optparse).

mandatory

Mandatory arguments.

vectorize

Arguments of the function to vectorize (comma-delimited). If numeric, use also number.

ignore

Arguments of the function to ignore.

number

Force these arguments as numerics. Useful for numeric vectors (see vectorize) or arguments with no defaults.

defaults

Defaults to use instead of the ones provided by the formals.

o_desc

Descriptions of the options. Help from rd is ignored for arguments present in this list.

p_desc

Description Description of the function. Help from rd is ignored for the function description unless this value is an empty string.

Value

Returns a list with keys:

  • options, a named list with the values for the function's arguments

  • args, a vector with zero or more strings containing the positional arguments

Author(s)

Luis M. Rodriguez-R [aut, cre]


enveomics.R documentation built on April 13, 2022, 5:10 p.m.