powered by
Encode a vector x to a factor and then to a numeric value. It's a simple shortcut for as.numeric(factor(x, ...))
as.numeric(factor(x, ...))
Nf(x, ...)
numeric vector
a vector of data, usually taking a small number of distinct values.
the dots are passed on to factor
factor
Andri Signorell <andri@signorell.net>
N
x <- LETTERS[10:15] Nf(x) # same as .. as.numeric(factor(x))
Run the code above in your browser using DataLab