powered by
Convert factor to numeric without losing information on the label
unfactor(f)
A numeric vector
A factor
unfactor(factor(c("1","3","3"),levels=c("1","3"))) # contrast this to: as.numeric(factor(c("1","3","3"),levels=c("1","3")))
Run the code above in your browser using DataLab