0
我想通过引用表来替换列名称。通过引用R中的表文件替换列名称
以下是我的问题。
data <- read.table(textConnection("
a b c d e
row1 1 2 3 4 5
"), header = TRUE)
Newtitle <- read.table(textConnection("
id id2
a kitty
d oren
g dyron
"), header = TRUE)
如果新标题$ ID匹配,在数据的列名,
那么我想更换新标题由$ ID2数据的列名,否则只保留原来的列名。
kitty b c oren e
row1 1 2 3 4 5
有什么提示吗?