[R] combination

Val valkremk at gmail.com
Thu Apr 13 03:28:24 CEST 2017


Hi all,
I have two variables x and y. X has five observation and y has three.
I want combine each element of x to  each element of y values to
produce 15  observation. Below is my sample data and desired output

data
x   Y
1   A
2   B
3   C
4
5

Output
1  A
1  B
1  C
2  A
2  B
2  C
3  A
3  B
3  C
4  A
4  B
4  C
5  A
5  B
5  C

Thank you in advance



More information about the R-help mailing list