title: Parsing on the first instance of a set of values
body: <p>I have a dataframe in R as follows.</p>
  <pre><code>test &lt;- data.frame(&quot;FRUITSTRING&quot; = c(&quot;APPLE_PEAR_BANANA&quot;,
                                       &quot;TURNIP_CABBAGE_ORANGE_PEAR_BANANA&quot;,
                                       &quot;APPLE_CARROT_PEAR_BANANA&quot;), 
                     &quot;SPLIT_CHAR&quot; = c(&quot;PEAR&quot;,&quot;ORANGE&quot;,&quot;PEAR&quot;))
  </code></pre>
  <p>I wish to split the column FRUITSTRING into two columns but make it split on a row by row basis dependent on the value of the 2nd column called SPLIT_CHAR. Is it possible to do this? Note The string length can change and the position of the split character can change and this is why I want to call a particular character in order to do the split.</p>
  <p>The function I have used previously was cSplit however I no idea how to pass this dataframe into cSplit and to use the valve of another column as the input to csplit.
  Thanks</p>