powered by
Converts the factor labels to numeric values and returns the factor as a numeric vector
fac2num(x)
A factor
Returns a numeric vector of the same length as x
Returns a vector of numeric values. Elements in the input factor that cannot be converted to numeric will produce NA.
# NOT RUN { f <- factor(c(1,2,1,3,2,1,2,3,1)) fac2num(f) # }
Run the code above in your browser using DataLab