R/factor_to_numeric.R

factornum.Rd

Convert a factor with numeric levels to a non-factor (numeric).

factornum(x)

A vector containing a factor with numeric levels.

The input factor made into a numeric vector.

x <- factor(c(3, 4, 9, 4, 9), levels = c(3, 4, 9)) factornum(x)#> [1] 3 4 9 4 9#