title: Is there a way to paste together the elements of a vector in R without using a loop?
body: <p>Say there's a vector x:</p>
  
  <pre><code>x &lt;- c("a", " ", "b")
  </code></pre>
  
  <p>and I want to quickly turn this into a single string "a b". Is there a way to do this without a loop? I know with a loop I could do this:</p>
  
  <pre><code>y &lt;- ""
  for (i in 1:3){
      paste(y, x[i], sep = "")
  }
  
  &gt; y
  [1] "a b"
  </code></pre>
  
  <p>but I will need to do this over many, many iterations, and having to loop over this and replace the original with the new each time would become very time consuming. I always want to be able to do something like this:</p>
  
  <pre><code>x &lt;- paste(x)
  </code></pre>
  
  <p>as if paste() could smartly divide up the elements of a vector itself, but I know it can't. Is there another function, or a more creative way to use paste(), which can accomplish this efficiently?</p>