SyntaxFix
Write A Post
Hire A Developer
Questions
lapply is pretty much designed for this
unfactorize<-c("colA","colB") df[,unfactorize]<-lapply(unfactorize, function(x) as.numeric(as.character(df[,x])))