Merge r brings error “'by' must specify uniquely valid columns”

后端 未结 2 704
名媛妹妹
名媛妹妹 2021-01-03 20:43

R doesn\'t like me today...

I have two tables asembled via cbind(). Tab 1 (dwd_nogap) is

  x1                 col1_x1       col2_x1          


        
2条回答
  •  别那么骄傲
    2021-01-03 21:40

    This is what I tried for a right outer join [as per my requirement]:

    m1 <- merge(x=companies, y=rounds2, by.x=companies$permalink, 
                by.y=rounds2$company_permalink, all.y=TRUE)
    # Error in fix.by(by.x, x) : 'by' must specify uniquely valid columns
    m1 <- merge(x=companies, y=rounds2, by.x=c("permalink"), 
                by.y=c("company_permalink"), all.y=TRUE)
    

    This worked.

提交回复
热议问题