x <- "a"
check_string(x)
if (FALSE) {
# `x` must have type character
x <- c
check_string(x)
# `x` must have length 1
x <- c("a", "b")
check_string(x)
# `NA_character_` is not acceptable
x <- NA_character_
check_string(x)
}
Run the code above in your browser using DataLab