Is there a shorter version for the folowing principle to rename certain columns of a data frame?
data1<-data.frame(\"a\"=1:3,\"b\"=1:3,\"c\"=1:3) data1Names&
setNames can be helpful
setNames
> setNames(data1, c("hello", "b", "world")) hello b world 1 1 1 1 2 2 2 2 3 3 3 3
another alternative
> names(data1)[names(data1) %in% c("a", "c")] <- c("hello", "world") > data1 hello b world 1 1 1 1 2 2 2 2 3 3 3 3