title: How do I output one vector for a matrix or dataframe in which each element is a string concatenated from each row?
body: <p>I have a matrix (or dataframe):</p>
  
  <pre><code>m1 &lt;- matrix(letters[1:8], ncol = 2, byrow=TRUE)
  
       [,1] [,2]
  [1,] "a"  "b" 
  [2,] "c"  "d" 
  [3,] "e"  "f" 
  [4,] "g"  "h" 
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>vec1 = c("ab", "cd", "ef", "gh")
  </code></pre>
  
  <p>I would prefer this would work for a matrix of any column or row size. Base R and dplyr appreciated.  </p>