Skip to contents

Converts a character vector (or anything [as.character()] accepts) to a `charvec`. If `x` is already a `charvec` it is returned unchanged. Names are preserved; other attributes are dropped.

Usage

as_charvec(x)

Arguments

x

object to convert.

Value

A `charvec` (an ALTREP character vector).

Examples

as_charvec(letters)
#>  [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s"
#> [20] "t" "u" "v" "w" "x" "y" "z"