title: Create new column with dplyr mutate and substring of existing column
body: <p>I have a dataframe with a column of strings and want to extract substrings of those into a new column.</p>
  
  <p>Here is some sample code and data showing I want to take the string after the final underscore character in the <code>id</code> column in order to create a <code>new_id</code> column.
  The <code>id</code> column entry always has 2 underscore characters and it's always the final substring I would like.</p>
  
  <pre><code>df = data.frame( id = I(c("abcd_123_ABC","abc_5234_NHYK")), x = c(1.0,2.0) )
  
  require(dplyr)
  
  df = df %&gt;% dplyr::mutate(new_id = strsplit(id, split="_")[[1]][3])
  </code></pre>
  
  <p>I was expecting strsplit to act on each row in turn.</p>
  
  <p>However, the <code>new_id</code> column only contains <code>ABC</code> in each row, whereas I would like <code>ABC</code> in row 1 and <code>NHYK</code> in row 2. Do you know why this fails and how to achieve what I want?</p>