【发布时间】:2016-10-17 09:42:17
【问题描述】:
我有这样的数据框
> d <- data.frame(team.aaa=1:3, team.aab=4:6, team.aac=7:9)
> d
# team.aaa team.aab team.aac
#1 1 4 7
#2 2 5 8
还有,想要的输出
d <- rename(d, c("team.aaa"="aaa_team", "team.aab"="aab_team", "team.aac"="aac_team"))
> d
# aaa_team aab_team aac_team
#1 1 4 7
#2 2 5 8
#3 3 6 9
我可以用重命名字符串来做,但由于数据量很大,我想使用搜索和替换选项 非常感谢提前
【问题讨论】: