A simple function to rename columns in data frame to standardized names in R
Most R functions are vectorized, you don't need the for loop:

colRename &lt;- function(x) {
   setNames(x, paste0("column", seq_len(ncol(x))))
}