powered by
A simple function for converting factors to numeric values
factor2numeric(x)
A vector of type factor
factor
x converted to a numeric vector
x
# NOT RUN { # Define a factor object y <- factor(5:7) y # incorrectly convert to numeric as.numeric(y) # correctly convert factor2numeric(y) # }
Run the code above in your browser using DataLab