Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在数据框中有多个不同名称的列。对于他们所有人,我想添加一个共同的后缀
tot_proc
所以,例如
DF a b c
->
DF a_tot_proc b _tot_proc c_tot_proc
我只能弄清楚如何为列名添加前缀:
colnames(DF) <- paste("tot_proc", colnames(DF), sep = "_")
但不是后缀。你能帮帮我吗?谢谢!
你可以换个顺序。
colnames(DF) <- paste(colnames(DF), "tot_proc", sep = "_")