insist: insist

Description Usage Arguments Details Value Examples

View source: R/insist.R

Description

Insists a object meets a given criteria

Usage

1
insist(., test, continue = TRUE)

Arguments

.

object

test

logical test, expression

continue

if true prints error, if false throws error

Details

Tests if the object meets the citeria. If it does, the object is returned. If not, an error is thrown unless continue is true, in which case the error is returned. Test should be an expression that refers to the object as .

Value

the object

Examples

1
2
3
require(magrittr)
pi %>% insist(. > 3) 
pi %>% insist(length(.) == 1)

richardjtelford/rjt.misc documentation built on July 1, 2021, 9:56 a.m.