unfactor {pcFactorStan} | R Documentation |
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.
unfactor(f)
f |
a factor |
f <- factor(letters[1:3])
print(f)
print(unfactor(f))