data[ , i] <- apply(data[ , i], 2, # Specify own function within apply function(x) as.numeric(as.character(x)))