Table 1 (900 rows) identifies the regulators of each cluster:
reg cluster weight
a 0 59
b 0 52
e 1 46
f 1 46
g 2 66
h 2 18
Table 2 (90 rows) identifies the genes belonging to each cluster:
gene cluster
1 0
2 1
3 0
4 2
5 0
6 0
7 1
I want to create a table 3 from these two that looks like this:
reg gene weight
a 1 59
a 3 59
a 5 59
a 6 59
b 1 52
b 3 52
b 5 52
b 6 52
e 2 46
e 7 46
…
i.e., I want a list of every interaction between regs and genes. How can I do this in R?