title: Why str_trim of a matrix returns a vector?
body: <p>In order to deal with trailing/leading spaces, I found out this function <code>str_trim</code>. When applied to a matrix of strings, it return a vector. I am confused.</p>
  
  <pre><code>library(stringr)
  str_trim(matrix("   strings     ",3,3))
  </code></pre>
  
  <p>In fact, I usually use <code>gsub</code>, and when applied to a matrix, gsub return a matrix, which is normal.</p>