Batch convert columns to numeric type

You can use sapply for this:

dat <- sapply( dat, as.numeric )

If not every column needs converting:

library( taRifx )
dat <- japply( dat, which(sapply(dat, class)=="character"), as.numeric )

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)