check_alt_args: Check if argument(s) are given as alternatives to another

Description Usage Arguments Examples

Description

Check for certain arguments that, if present, will result in function producing an error and stopping the function if desired.

Usage

1
check_alt_args(..., target, alts, stop = TRUE)

Arguments

...

Named arguments. Typically passed from another function.

target

String of variable for which alternatives may be present.

alts

Character vector of arguments that may act as alternatives to the target

stop

Boolean. If True, stop() is called with an error message. If False, warning() is called with an error message.

Examples

1
2
3
4
5
6
## Not run: 
check_alt_args(a = 10, target = "a", alts = c("b"))
check_alt_args(b = 10, target = "a", alts = c("b"))
check_alt_args(b = 10, target = "a", alts = c("b"), stop = FALSE)

## End(Not run)

drsimonj/twidlr documentation built on May 15, 2019, 2:53 p.m.