Skip to contents

Returns TRUE if x is a string (character vector of length 1).

Usage

is_string(x)

Arguments

x

The object to be tested.

Value

Scalar logical

Examples

#----------------------------------------------------------------------------
# is_string() examples
#----------------------------------------------------------------------------
library(bkbase)

# TRUE
is_string("a")
#> [1] TRUE
is_string(NA_character_)
#> [1] TRUE

# FALSE
is_string(c("a", "b"))
#> [1] FALSE
is_string(character(0L))
#> [1] FALSE
is_string(1L)
#> [1] FALSE
is_string(NULL)
#> [1] FALSE