convert a value to character
util_ensure_character(x, error = FALSE, error_msg, ...)
as.character(x)
the value
logical if TRUE
, an error is thrown, a warning otherwise
in case of a conversion error
error message to be displayed, if conversion was not possible
additional arguments passed to util_error or util_warning
respectively in case of an error, and if an error_msg
has
been passed