比如
e
row. names wushu lush jiuliu
sw 1 5 6
de 3 3 6
fr 4 5 6
gt 4 6 3
hy 3 5 12
ju 13 34 56
ji 12 34 43
f
row. names sample size tie
de Nada as tf
hy as Ed fs
gt as ft df
现在想要的就是从e矩阵中重新构建出只有de,hy,gt列名的三行矩阵,行名不变。(de,hy,gt来源于f矩阵)然后运行
g=dplyr::inner_join(f,e,by =row.names)
Error in UseMethod("tbl_vars") :
"tbl_vars"没有适用于"c('matrix', 'character')"目标对象的方法
运行g=merge(f,e,by =row.names)
Error in as.vector(x,mode):
cannot coerce type ‘closure’to vector of type 'any'