mergedata <- merge (dataset1, dataset2, by.x="personalid")
Error in fix.by(by.x, x) : 'by' must specify a uniquely valid column
mergedata <- merge (dataset1, dataset2, by.x="personalid")
Error in fix.by(by.x, x) : 'by' must specify a uniquely valid column
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")