Is there a more concise way to write the following code? library(gdata) mydataOUTPUTrtfA <- read.csv("mergedStatstA.csv") save(mydataOUTPUTrtfA, file="mydataOUTPUTrtfA.RData") mydataOUTPUTrtfA <- rename.vars(mydataOUTPUTrtfA, from="X", to="Statistics.Calculated", info=FALSE)
mydataOUTPUTrtfB <- read.csv("mergedStatstB.csv") save(mydataOUTPUTrtfB, file="mydataOUTPUTrtfB.RData") mydataOUTPUTrtfB <- rename.vars(mydataOUTPUTrtfB, from="X", to="Statistics.Calculated", info=FALSE) mydataOUTPUTrtfC <- read.csv("mergedStatstC.csv") save(mydataOUTPUTrtfC, file="mydataOUTPUTrtfC.RData") mydataOUTPUTrtfC <- rename.vars(mydataOUTPUTrtfC, from="X", to="Statistics.Calculated", info=FALSE) I will have a series of mydataOUTPUTrtf files spanning a large portion of the alphabet, so to speak: e.g. mydataOUTPUTrtfA to mydataOUTPUTrtfG --- thanks for your help -- View this message in context: http://r.789695.n4.nabble.com/condense-repetitive-code-for-read-csv-and-rename-vars-tp4673783.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.