dot-get_command_argument: Get an specific argument from the command line

.get_command_argumentR Documentation

Get an specific argument from the command line

Description

Get an specific argument from the command line

Usage

.get_command_argument(
  x,
  argument,
  prefix = "--",
  default = FALSE,
  verbose = FALSE
)

Arguments

x

The command line arguments, from x = commandArgs()

argument

The name of the argument.

prefix

The prefix to any argument of interest, the default is "–"

default

Default value to return is argument is missing, default to FALSE.

verbose

Boolean, if TRUE, shows a warning when the parameter is not found.

Value

The value of the argument, assumed to be followed after '=' or, TRUE if nothing but the argument was found. If the argument is not found, FALSE is returned.

Examples

.get_command_argument(commandArgs(), "interactive")
.get_command_argument(commandArgs(), "RStudio")
.get_command_argument(commandArgs(), "RStudio", prefix="")
.get_command_argument(commandArgs(), "vanilla")
.get_command_argument("--control.file=baz.txt", "control.file")

roliveros-ramos/calibrar documentation built on March 15, 2024, 12:08 a.m.