Change multiple columns to as.numeric from factor

    # look for the columns in the data matrix. In this case: columns 4 to 11
    data[,4:11]
    # Then change them as to numeric
    data[,4:11] <- sapply(data[,4:11], as.numeric(as.character(data[,4:11])))      

Source