Checks Int

check_int(x, x_name = substitute(x))

Arguments

x

The scalar integer to check.

x_name

A string of the name of x.

Value

Throws an informative error or returns an invisible copy of x.

Examples

try(check_int(1))
#> Error : 1 must be of class 'integer'