How to create a data set with any possible combination of two data sets?
For example, there would be two datasets with specific columns:
ds1 = letters[1:4] ds2 = letters[5:8]
There are also meanings associated with each letter if it affects anything (I don't think it should be).
ds1 = data.frame(a=letters[1:4],b=1:4) ds2 = data.frame(a=letters[5:8],b=5:8)
In the last dataset, I would like each combination of ds1 and ds2 (e.g. ae, af, ag, etc.)
At first, I thought about using merge , so I tried to do this, but that didn't work. I thought that for the loop would probably be the answer, but I'm not sure how I will start.
Suggestions? Thanks!
source share