Reputation: 31
How can I change the variable(column) names in R? I couldn't do it with plyr package or any other data manipulation R package.
Upvotes: 0
Views: 9043
Reputation: 4079
You can also make it like this:
df <- data.frame("1", "b", "test")
names(df) <- c("Name 1", "Name 2", "Name 3")
Upvotes: 1
Reputation: 1632
If you want to change the column names:
colnames(DataFrame)[colnames(DataFrame)=="Old Column Name"] <- "New Column Name"
Upvotes: 0