I\'m renaming the majority of the variables in a data frame and I\'m not really impressed with my method.
Therefore, does anyone on SO have a smarter or faster way t
I would use ifelse:
ifelse
names(temp.mtcars) <- ifelse(names(mtcars) %in% c("mpg", "cyl", "disp"), names(mtcars), paste("bar", names(mtcars), sep = "."))