title: Combination of Vectors in R of different Lengths
body: <p>I have two vectors of zip codes (sites and customers). I am trying to find the combination of pairs between the two vectors.</p>
  
  <p>Hence, if sites is size 3 and customers is size 4...I would expect 12 combinations. I am currently using crossing() to do this in R. </p>
  
  <p>However, when I put in my actual data sites of size 20 and customers size 6057, the function returns 35,760 combinations when I expected 121,140 (6057*20) combinations. Does that mean that there were that many duplicated combinations and they were removed?</p>
  
  <p>my code is copied below. Thanks in advance.</p>
  
  <pre><code>data &lt;- read_xlsx("Sites.xlsx", sheet = "Sheet3")
  data2 &lt;- read_xlsx("Customers.xlsx", sheet = "Sheet1")
  
  sites &lt;- as.vector(data['FRT - Ship From Zip'])
  sites
  
  Customers &lt;- as.vector(data2['Ship_To_Zip'])
  Customers
  
  Comdata &lt;- crossing(Customers,sites)
  Customers &lt;- as.vector(Comdata['Ship_To_Zip'])
  sites &lt;- as.vector(Comdata['FRT - Ship From Zip'])
  </code></pre>