warnif: Issue a warning if condition is TRUE

View source: R/Stringendo.R

warnifR Documentation

Issue a warning if condition is TRUE

Description

The warnif() function issues a warning if the condition is TRUE. It is the opposite of warnifnot(), which warns if the condition is not TRUE. This function is useful for issuing warnings when a certain condition is met.

Usage

warnif(...)

Arguments

...

Logical conditions to be checked. Each condition must evaluate to a logical vector. Named arguments will use the name as the warning message.

Value

The function returns invisible(), but issues warnings for each condition that evaluates to TRUE.

Examples

warnif(6 > 4, 6 > 5)
warnif("custom message" = 6 > 5)


vertesy/Stringendo documentation built on Nov. 10, 2024, 4:35 a.m.