fail_if: Fail conditionally

View source: R/error_handling.R

fail_ifR Documentation

Fail conditionally

Description

Fail on not TRUE and give a custom error message.

Usage

fail_if(x, msg = "There was an error", extended = F)

Arguments

x

(any object) The object to test.

msg

(chr) An error message.

extended

(lgl) Whether to convert to logical.

Value

Invisibly returns the input.

Examples

fail_if(T)
fail_if(1) #does not convert types
fail_if(1, extended = T)

Deleetdk/kirkegaard documentation built on June 7, 2024, 7:49 a.m.