is_real_value: Check if the passed entity is a single floating point value....

View source: R/real_value.R

is_real_valueR Documentation

Check if the passed entity is a single floating point value. Optionally, specify the minimum and maximum values allowed, either inclusive or exclusive.

Description

Check if the passed entity is a single floating point value. Optionally, specify the minimum and maximum values allowed, either inclusive or exclusive.

Usage

is_real_value(
  value,
  min = NULL,
  max = NULL,
  inclusive_min = TRUE,
  inclusive_max = TRUE,
  allow_na = FALSE,
  allow_null = FALSE
)

Arguments

value

the value to check

min

the minimum allowed value, inclusive or exclusive.

max

the maximum allowed value, inclusive or exclusive.

inclusive_min

if TRUE (default) the min value is checked inclusive. If FALSE, the min value will be checked exclusive.

inclusive_max

if TRUE (default) the max value is checked inclusive. If FALSE, the max value will be checked exclusive

allow_na

if true, accept a value that is NA.

allow_null

if true, accept a value that is NULL.

Examples

## Not run: 
# For assertion
assertthat::assert_that(qscheck::is_real_value(value))
# For check
if (qscheck::is_real_value(value)) {}

## End(Not run)


AstraZeneca/qscheck documentation built on Nov. 1, 2023, 4:45 a.m.