I have three sets of identifiers: "x", "y" and "z". I also have two, 2-column data frames, each of which maps one set of identifiers to another set of identifiers.
x2y = data.frame( x = c("A","A","B","B","C","D","E","F"),
y = c(1,2,1,2,3,4,4,5) )
y2z = data.frame( y = c(1,1,2,3,4,4,5,5,5),
z = c(1,2,3,3,6,7,6,7,8) )
This can be seen in the figure below. Notice that each arrow corresponds to one row in the data frame.

Question:
How to use these two mappings (two data frames) to create a mapping from xto z(displayed to the right of the figure above). I think of it as a "transitive mapping": x to yand y to zgives x to z. The data frame that I would like ...
x2z = data.frame( x = c("A","A","A","B","B","B","C","D","D","E","E","F","F","F"),
z = c(1,2,3,1,2,3,3,6,7,6,7,6,7,8) )
: ~ 50 000 , . , .
, R.