Error in fix.by(by.x, x) : 'by' must specify a uniquely valid columnmergedata <- merge (dataset1, dataset2, by.x=“personalid”) [closed]

白昼怎懂夜的黑 提交于 2021-02-10 18:11:05

问题


mergedata <- merge (dataset1, dataset2, by.x="personalid")

Error in fix.by(by.x, x) : 'by' must specify a uniquely valid column


回答1:


The OP had specified only the by.x. If the column names are the same, then by can be used

merge(dataset1, dataset2, by="personalid") 

If the by variable names are different, then we need to specify the by.y as well

merge(dataset1, dataset2, by.x="personalid", by.y = "somethingelse") 


来源:https://stackoverflow.com/questions/49954874/error-in-fix-byby-x-x-by-must-specify-a-uniquely-valid-columnmergedata

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!