factor2numeric {Smisc} | R Documentation |
A simple function for converting factors to numeric values
factor2numeric(x)
x |
A vector of type |
x
converted to a numeric vector
# Define a factor object y <- factor(5:7) y # incorrectly convert to numeric as.numeric(y) # correctly convert factor2numeric(y)