title: Separate a column into two columns based on nth occurrence of delimiter
body: <p>Using R, what do I need to do to split col4 of TABLEA below into col4a and col4b of TABLEB below?  I can't figure out how to get this to work, when there might not always be a 3rd &quot;-&quot; to split on.</p>
  <p>TABLEA:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>col1</th>
  <th>col2</th>
  <th>col3</th>
  <th>col4</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>data</td>
  <td>data</td>
  <td>data</td>
  <td>hippo-11-trx-2021</td>
  </tr>
  <tr>
  <td>data</td>
  <td>data</td>
  <td>data</td>
  <td>goose-17-plt-2017</td>
  </tr>
  <tr>
  <td>data</td>
  <td>data</td>
  <td>data</td>
  <td>monkey-01-mno</td>
  </tr>
  <tr>
  <td>data</td>
  <td>data</td>
  <td>data</td>
  <td>zebra-99-451-2019</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>TABLEB:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>col1</th>
  <th>col2</th>
  <th>col3</th>
  <th>col4a</th>
  <th>col4b</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>data</td>
  <td>data</td>
  <td>data</td>
  <td>hippo-11-trx</td>
  <td>2021</td>
  </tr>
  <tr>
  <td>data</td>
  <td>data</td>
  <td>data</td>
  <td>goose-17-plt</td>
  <td>2017</td>
  </tr>
  <tr>
  <td>data</td>
  <td>data</td>
  <td>data</td>
  <td>monkey-01-mno</td>
  <td>NA</td>
  </tr>
  <tr>
  <td>data</td>
  <td>data</td>
  <td>data</td>
  <td>zebra-99-451</td>
  <td>2019</td>
  </tr>
  </tbody>
  </table>
  </div>