title: Create a column of initials from a column of names as a string in R
body: <p>Here's an example df I want to extract the capital letters from:</p>
  
  <pre><code>df &lt;- data.frame(a = c(1:5), b = c("Words are Here", "Okay", "Be Good Now", "WTF are you Doing", "it's good"))
  </code></pre>
  
  <p>When I use <code>str_extract_all(df$b, "[A-Z]", simplify = )</code> I get a list of all the caps
  with simplify = TRUE:</p>
  
  <pre><code>    [,1] [,2] [,3] [,4]
  [1,] "W"  "H"  ""   ""  
  [2,] "O"  ""   ""   ""  
  [3,] "B"  "G"  "N"  ""  
  [4,] "W"  "T"  "F"  "D" 
  [5,] ""   ""   ""   ""  
  </code></pre>
  
  <p>or with simplify = FALSE:</p>
  
  <pre><code>[[1]]
  [1] "W" "H"
  
  [[2]]
  [1] "O"
  
  [[3]]
  [1] "B" "G" "N"
  
  [[4]]
  [1] "W" "T" "F" "D"
  
  [[5]]
  character(0)
  </code></pre>
  
  <p>I don't know how to take either of these to get my desired output which is a vector like:</p>
  
  <pre><code>("WH", "O", "BGN", "WTFD", "")
  </code></pre>