【发布时间】:2021-12-15 10:56:21
【问题描述】:
我想在数据框中的列名末尾添加一串文本。我该怎么做?
示例数据(我想将列名 A、B、C、D、E 更改为 Atext、Btext、Ctext、Dtext、@ 987654330@):
df <- structure(list(User_ID = 1:4, A = c(0.815353067, 0.698314902, 0.774619233, 0.949620322),
B = c(0.684046246, 0.427028078, 0.579449798, 0.977426626),
C = c(0.101562005, 0.943064479, 0.19946195, 0.70068721),
D = c(0.525384365, 0.638082727, 0.651924335, 0.112375646),
E = c(0.415664129, 0.006406548, 0.85036104, 0.510504667)),
class = "data.frame", row.names = c(NA, -4L))
【问题讨论】: