Suppose that I want to convert factor to number. I write the following code:
fac <- factor(c(2.3, 1.5, 3, 4.9)) as.numeric(fac)