r - inner_join or merge remain second id colum -


i have conducted inner_join or merge function in r. want remain second id column "di" in result.

library(dplyr) ab<-data.frame(id=(c("pdm.999993856","pdm.999960488")),oi=rep("r",2),stringsasfactors = false) to<-data.frame(di=c("pdm.999993856","pdm.999960488"),kl=rep("foo",2),stringsasfactors=false) inner_join(ab,to, by=c("id"="di")) 

we can try

 %>%     mutate(id = di) %>%     inner_join(., ab, = "id") 

Comments

Popular posts from this blog

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

testing - Detect whether test has failed within fixture -

android - Create single AAR file from multiple modules using Gradle -