【发布时间】:2020-07-27 18:24:11
【问题描述】:
在 R 中使用 make.unique 函数将通过附加 . 和来自 1 的索引来生成唯一变量,例如:
make.unique(c("a1","a1","a1"))
[1] "a1" "a1.1" "a1.2"
我正在寻找一个在索引周围加上括号的函数,例如:
make.unique.NEW(c("a1","a1","a1"))
[1] "a1" "a1(1)" "a1(2)"
【问题讨论】: