powered by
Checks if character scalar using
is.character(x) && length(x) == 1L
chk_chr(x, x_name = NULL)vld_chr(x)
vld_chr(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_chr(): Validate Character Scalar
vld_chr()
Other deprecated: chk_dbl(), chk_deprecated, chk_wnum()
chk_dbl()
chk_deprecated
chk_wnum()
chk_chr("a") try(chk_chr(1)) # vld_chr vld_chr("") vld_chr("a") vld_chr(NA_character_) vld_chr(c("a", "b")) vld_chr(1)
Run the code above in your browser using DataLab