R matching more than 2 conditions and return the response value

前端 未结 4 1869
名媛妹妹
名媛妹妹 2021-01-18 20:25

Hi I have two data set where the first one is a set of index:

ind1<-rep(c(\"E\",\"W\"), times=20)
ind2<-sample(100:150, 40)
y<-c(1:40)
index<-dat         


        
4条回答
  •  时光取名叫无心
    2021-01-18 20:50

    you can use also left_join() from dplyr package:

    require(dplyr)
    left_join(data, index, by = c("x1" = "ind1", "x2" = "ind2"))    
    

    read more here

提交回复
热议问题