Encode a Vector of Character
Usage
encode(x, level = 1, chars = printable_chars(level))
Arguments
- x
vector of character
- level
one of 1, 2, or 3 defining which character set to use for encoding, see
printable_chars
.- chars
vector of characters to be used for encoding
Value
vector of character as long as x
with each element containing
the encoded version of the corresponding element in x
. The returned
vector has an attribute codes
being a named vector. This vector
contains the unique values in x
as elements. Each element is named
by the code that was used to encode the corresponding element.