Let's say I have a vector V
of categorical variable L = c("a", "b", "c")
:
V <- c("a", "a", "b", "c", "b", "c")
I want to encode every value of L
with numbers and update V according to this encoding.
So, the new vector is:
Vnew = c(1, 1, 2, 3, 2, 3)
Would you help me with it?