stopwarn: Helper Function for Validation Errors

Description Usage Arguments Value Examples

Description

Matches error type to stop or warning and produces the respective error and returns NULL.

Usage

1
stopwarn(error = "warn", error.msg)

Arguments

error

one of 'warn' or 'stop'. Taken as warning if not 'stop'.

error.msg

string to parse as error message.

Value

error if 'error' == 'stop'; NULL and warning otherwise.

Examples

1
2
3
4
5
## Not run: 
if(2 > 1) stopwarn("warn", "This number is too big")
if(2 < 3) stopwarn("stop", "This number is too small")

## End(Not run)

RaphaelS1/RSmisc documentation built on June 7, 2019, 8:20 p.m.