is_single_numeric: Check whether a value is a single numeric

Description Usage Arguments Examples

View source: R/assertions.R

Description

Check whether a value is a single numeric

Usage

1

Arguments

x

A value to be tested

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
library(assertthat)
assert_that(is_single_numeric(1))
# TRUE

assert_that(is_single_numeric(Inf))
# TRUE

assert_that(is_single_numeric(1.6))
# TRUE

assert_that(is_single_numeric(NA))
# Error: NA is not a single numeric value

assert_that(is_single_numeric(1:6))
# Error: 1:6 is not a single numeric value

assert_that(is_single_numeric("pie"))
# Error: "pie" is not a single numeric value

## End(Not run)

dynutils documentation built on March 22, 2021, 5:06 p.m.