r - Can dplyr join on multiple columns or composite key? -


I realize that dplyr v3.0 allows you to be included on various variables:

left_join (x, y, by = c ("a" = "b") mail xa to yb

However, is it possible to join the combination of variables? Or do I have to add the overall key before time?

Something like this:

< Code to match coincidence of [xa and xc ]> left_joy (x, y, by = c ("ac" = "beedi") yb and yd ]

You can pass left_join () :

  Library (dplyr) d1 & lt; - A named vector of more than 1 length (X = letters [1: 3], y = letters [1: 3], a = rannomor (3)) D2 for  by  argument  And lt; - data_frame (x2 = letters [3: 1], y2 = letter [3: 1], b = rnorm (3)) left_join (d1, d2, by = c ("x" = "x2", " Y "=" y2 "))   E 

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -