powered by
Checks if whole numeric scalar using
is.numeric(x) && length(x) == 1L && (is.integer(x) || vld_true(all.equal(x, trunc(x))))
chk_wnum(x, x_name = NULL)vld_wnum(x)
vld_wnum(x)
The chk_ function throws an informative error if the test fails or returns the original object if successful so it can used in pipes.
chk_
The vld_ function returns a flag indicating whether the test was met.
vld_
The object to check.
A string of the name of object x or NULL.
vld_wnum(): Validate Whole Numeric Scalar
vld_wnum()
Other deprecated: chk_chr(), chk_dbl(), chk_deprecated
chk_chr()
chk_dbl()
chk_deprecated
# chk_wnum chk_wnum(1) try(chk_wnum(1.1)) # vld_wnum vld_wnum(1) vld_wnum(double(0)) vld_wnum(NA_real_) vld_wnum(c(1, 1)) vld_wnum(1L)
Run the code above in your browser using DataLab