I am very new to R. How do I do a cross join in R? I have two tables and I want to create a new table from a cross join where each row of table 1 is copied across every row of table 2. Example below:
Table 1 Table 2 Result
a b c d e f a b c d e f
1 x1 x2 x3 1 y1 y2 y3 1 x1 x2 x3 y1 y2 y3
2 x4 x5 x6 2 y4 y5 y6 2 x1 x2 x3 y4 y5 y6
3 x7 x8 x9 3 y7 y8 y9 3 x1 x2 x3 y7 y8 y9
4 x4 x5 x6 y1 y2 y3
5 x4 x5 x6 y4 y5 y6
6 x4 x5 x6 y7 y8 y9
7 x7 x8 x9 y1 y2 y3
8 x7 x8 x9 y4 y5 y6
9 x7 x8 x9 y7 y8 y9