1

I think an example will make my question clearer

c1<- c('A','B','C')
c2<- c(1,2)

Desired Output

c1  |   c2
____________
 A  |   1
 A  |   2 
 B  |   1
 B  |   2
 C  |   1
 C  |   2 
Neoleogeo
  • 313
  • 2
  • 11

1 Answers1

2

a simple solution is the expand.grid function:

expand.grid(c1,c2)
DPH
  • 4,244
  • 1
  • 8
  • 18