chk_chr {chk}R Documentation

Check Character Scalar

Description

Checks if character scalar using

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

[Deprecated]

Usage

chk_chr(x, x_name = NULL)

vld_chr(x)

Arguments

x

The object to check.

x_name

A string of the name of object x or NULL.

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.

Functions

See Also

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

Examples

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)

[Package chk version 0.9.1 Index]