is_number_advanced: Check if x is a number

View source: R/is_functions.R

is_number_advancedR Documentation

Check if x is a number

Description

This function is designed for use with assert_create_advanced. It must return TRUE for the assertion to pass or a string representing the error message if the assertion should fail.

Usage

is_number_advanced(x)

Arguments

x

A value to be checked

Value

Returns invisible(TRUE) if x is a numeric value with length 1. Returns a string with an error message if x is not a numeric value or has a length other than 1.


assertions documentation built on June 7, 2023, 6:03 p.m.