Modified R script to manipulate column names