Factors & numeric

How to change a factor x into numerical numbers:

as.numeric(as.character(x))