> On 31-12-2014, at 08:40, Karim Mezhoud <kmezh...@gmail.com> wrote: > > Hi All, > I would like to choice between these two data frame convert. which is > faster? > > for(i in 1:ncol(DataFrame)){ > > DataFrame[,i] <- as.numeric(DataFrame[,i]) > } > > > OR > > DataFrame <- as.data.frame(apply(DataFrame,2 ,function(x) as.numeric(x))) > >
Try it and use system.time. Berend > Thanks > Karim > Ô__ > c/ /'_;~~~~kmezhoud > (*) \(*) ⴽⴰⵔⵉⵎ ⵎⴻⵣⵀⵓⴷ > http://bioinformatics.tn/ > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.