I have two data table, the first looks like this (Table1
):
The second one looks like this (Table2
):
I'm looking for a way to combine those two tables and make it look like this (Table3
):
I'll elaborate:
Table1
has more rows thanTable2
.Values in the
X
column ofTable1
may repeat several times ("a", "a", "d", "d", "h", "h", etc.), but each repeated value has a different value under theY
column ("a" - 1, "a" - 2, "d" - 5, "d" - 6, etc.).Some values in the
Y
column of Table1 may be the same for different values under the "X" column (for example: "b" - 3 and "e" - 3).The "Y" column of Table 1 and the "Y" column of Table2 are the keys for joining the tables (remember that Table1 has more rows than Table2 - meaning that all the values of Table2$Y are found in Table1$Y but not vice versa).
Eventually, Table3 should contain only the rows from columns "X" and "Y" from Table1 that have a unique value in column "Z" (forming a 3-column table).
I really hope my explanation is coherent, I find this joining operation very frustrating.
Thank you for your kind assistance. -A