Learn R Programming

chk (version 0.9.2)

chk_chr: 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)

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_chr(): Validate Character Scalar

    [Deprecated]

See Also

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

Examples

Run this code
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