Learn R Programming

HKRbook (version 0.1.3)

stopif: stopif

Description

A equivalent to stopifnot: if cond is TRUE then a error is thrown.

Usage

stopif(cond, txt)

Value

nothing

Arguments

cond

logical: condition to test

txt

character: error message

Examples

Run this code
if (interactive()) stopif(1+1==2, "1+1 can not be 2, this is fake science!")

Run the code above in your browser using DataLab