I have a data frame with 25 variables.
I would like to convert the columns 2:8 ; 10:17 ; 24:25 as numeric.
I am using a separate for loops to convert the data type. Is there a way, i could use a single for loop and convert them to numeric.
Also, I wanted to convert 9, 18 in date format.
It would be helpful, if you could help me to minimise my code to single for loop
for (i in 2:8){
claim[,i] <- as.numeric(claim[,i])
}
for(i in 10:17){
claim[,i] <- as.numeric(claim[,i])
}
for(i in 24:25){
claim[,i] <- as.numeric(claim[,i])
}