SyntaxFix
Write A Post
Hire A Developer
Questions
You can combine the two functions; coerce to characters thence to numerics:
> fac <- factor(c("1","2","1","2")) > as.numeric(as.character(fac)) [1] 1 2 1 2