title: Combinations using expand.grid in vector
body: <p>I'd like to use <code>expand.grid</code> in vector to create all the combinations of the factors in <code>myvec</code>, in a specific format and without duplicates. I try to:</p>
  <pre><code>myvec &lt;- c(&quot;B2&quot;,&quot;B3&quot;,&quot;B4&quot;,&quot;B8&quot;,&quot;NDVI&quot;,&quot;SAVI&quot;,&quot;SIPI&quot;,&quot;SR&quot;,&quot;RGI&quot;,&quot;TVI&quot;,
     &quot;MSR&quot;,&quot;PRI&quot;,&quot;GNDVI&quot;,&quot;PSRI&quot;,&quot;GCI&quot;) 
  grid &lt;- expand.grid(c(rep(myvec,length(myvec))), KEEP.OUT.ATTRS = FALSE, stringsAsFactors = FALSE)
  grid 
  #      Var1
  # 1      B2
  # 2      B3
  # 3      B4
  # 4      B8
  # 5    NDVI
  </code></pre>
  <p>But, doesn't work and my desirable output is:</p>
  <pre><code>grid 
  #      Var1
  # 1      B2_B3
  # 2      B2_B4
  # 3      B2_B8
  # ...
  # last B2_B3_B4_B8_NDVI_SAVI_SIPI_SR_RGI_TVI_MSR_PRI_GNDVI_PSRI_GCI
  </code></pre>
  <p>Please, any help with it?</p>