title: Data Transformation/ Paste in R
body: <p>Here is my colnames for my data frame. </p>
  
  <pre><code>colnames(new)[3:ncol(new)]
  [1] "tag12" "tag13" "tag14" "tag15" "tag16" "tag17" "tag18" "tag22" "tag23"
  [10] "tag24"
  </code></pre>
  
  <p>How do I create something like </p>
  
  <p>new.1&lt;- tag12 + tag13 + tag14......</p>
  
  <p>Here is my first try.</p>
  
  <pre><code>for ( i in 3:ncol(all.1))
  new.1&lt;-as.data.frame(paste(colnames(all.1)[c(i-1)],colnames(all.1)[c(i)],sep="+"))
  
        paste(colnames(all.1)[c(i - 1)], colnames(all.1)[c(i)], sep = "+")
  1                                                              tag3+tag4
  </code></pre>