Hi, thanks for your reply. I attached the example. I tried your suggestion:
data[is.factor(data)] <- lapply(data[is.factor(data)], function(x) as.numeric(as.character(x))) But I still have the var as factors. I'm thinking now, in the txt file the decimals numbers are separated with a coma. Would it be the reason? Thanks a lot! http://r.789695.n4.nabble.com/file/n2246983/pdvspt.txt pdvspt.txt -- View this message in context: http://r.789695.n4.nabble.com/as-integer-tp2245987p2246983.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.