check_character: Check if the object is a character

View source: R/check_character.R

check_characterR Documentation

Check if the object is a character

Description

Factors are converted to character.

Usage

check_character(x, name = "x", na_action = na.fail)

Arguments

x

the object to check

name

the name of the object to use in the error message

na_action

stats::na.fail() throws an error in case of NA (default). stats::na.omit() will return x without the NA values. stats::na.pass() will return x with the NA values.

Value

The function gives the character back. It throws an error when the input is not a character.

Examples

check_character(c("20", "b"))

inbo/n2khelper documentation built on March 26, 2022, 1:51 p.m.