I have an id dataset and a dimension dataset. I need to merge these two to create a new set of ids.
Here my sample dataset looks like:
ids.data <- data.frame(id.1=c(1,2),
id.2=c(11,12))
> ids.data
id.1 id.2
1 1 11
2 2 12
dims <- data.frame(dim=c("C","E","D"))
> dims
dim
1 C
2 E
3 D
I need to combine these two in a way that each id will have three ids below:
> ids.data.2
id.1 id.2
1 1_C 11_C
2 1_E 11_E
3 1_D 11_D
4 2_C 12_C
5 2_E 12_E
6 2_D 12_D
Any ideas? Thanks!