factor2char: Convert Index and String Vector into CharacterVector, and vice versa
Description
These two functions are an illustration of how as.character and
as.factor may be reimplemented at the C++ level.
Usage
factor2char(iv)
char2factor(sv)
Value
A Character Vector which at each position contains the level value of the
corresponding index, or a Factor, depending on the function
Arguments
iv
A Integer Vector corresponding to numeric representation of the factor
This vector is also expected to have an attribute ‘levels’ with the factor
levels