Learn R Programming

chk (version 0.9.2)

chk_dbl: Check Double Scalar

Description

Checks if double scalar using

is.double(x) && length(x) == 1L

[Deprecated]

Usage

chk_dbl(x, x_name = NULL)

vld_dbl(x)

Value

The chk_ function throws an informative error if the test fails or returns the original object if successful so it can used in pipes.

The vld_ function returns a flag indicating whether the test was met.

Arguments

x

The object to check.

x_name

A string of the name of object x or NULL.

Functions

  • vld_dbl(): Validate Double

    [Deprecated]

See Also

Other deprecated: chk_chr(), chk_deprecated, chk_wnum()

Examples

Run this code
# chk_dbl
chk_dbl(1)
try(chk_dbl(1L))
# vld_dbl
vld_dbl(1)
vld_dbl(double(0))
vld_dbl(NA_real_)
vld_dbl(c(1, 1))
vld_dbl(1L)

Run the code above in your browser using DataLab