t1o3ua
Last Updated: February 25, 2016
·
1.461K
· dionysios
083618effe3fca9cd4ecc895809833a8

Convert Factor to Vector in R

r

Surprisingly, there is no built-in command to convert a factor into a vector in R.
The following line will do the trick:

outputVector = as.numeric(levels(inputFactor)[as.integer(inputFactor)]
Say Thanks
Respond