modarg: Modify default arguments according to named vector or list

Description Usage Arguments Value Author(s) Examples

Description

Makes it easy to modify one or a few elements of a vector or list of default settings. This function is to be used within functions that contain vectors of control arguments such as colors for different elements of a plot

Usage

1
modarg(arg = NULL, default)

Arguments

arg

named vector or list of the elements that should override the settings in 'default'

default

named vector or list of default settings

Value

Same as the argument 'default' with elements replaced according to 'arg'

Author(s)

Werner A. Stahel

Examples

1
2
3
4
5
6
modarg(2, list(a=4, b="bb", c=NA))
modarg(c(b=2, d=6), c(a="4", b="bb", c=NA))
## This leads to a warning

## modarg(c(b=2, d=6), c(a="4", b="bb", c=NA))
## modarg(1:6, c(a="4", b="bb", c=NA))

regr0 documentation built on May 2, 2019, 4:52 p.m.

Related to modarg in regr0...