unfactor {pcFactorStan} | R Documentation |
Turn a factor back into a vector of integers
Description
Factors store values as integers and use a 'levels' attribute to map the integers to labels. This function removes the 'factor' class and levels attribute, leaving the vector of integers.
Usage
unfactor(f)
Arguments
f |
a factor |
Examples
f <- factor(letters[1:3])
print(f)
print(unfactor(f))
[Package pcFactorStan version 1.5.4 Index]