title: Collapse character vector into single string with each string on its own row
body: <p>How do you collapse a character vector with multiple strings into a single string and with spacing between each string so that each string will start on a new line/row in the collapsed string?</p>
  <p>I have a multiple string character vector like this:</p>
  <pre><code>text &lt;- c(&quot;This should be first row&quot;, &quot;This should be second row&quot;, &quot;This should be third row&quot;)
  </code></pre>
  <p>I would like to collapse it into a single string, but create spacing so that each string have an individual row. Essentially, I want the string to look like the output from cat(paste()).</p>
  <pre><code>cat(paste(text, collapse = &quot;\n&quot;))
  </code></pre>
  <p>However, if try to store the output from cat(paste(text, collapse = &quot;\n&quot;)), the object returns as NULL.</p>
  <pre><code>test &lt;- cat(paste(text, collapse = &quot;\n&quot;))
  </code></pre>
  <p>Any suggestions for a solution?</p>