How do I split a string with tidyr::separate in R and retain the values of the separator string?
<p>I have a data set:</p>

<pre><code>crimes&lt;-data.frame(x=c("Smith", "Jones"), charges=c("murder, first degree-G, manslaughter-NG", "assault-NG, larceny, second degree-G"))
</code></pre>

<p>I'm using tidyr:separate to split the charges column on a match with "G,"</p>

<pre><code>crimes&lt;-separate(crimes, charges, into=c("v1","v2"), sep="G,")
</code></pre>

<p>This splits my columns, but removes the separator "G,". I want to retain the "G," in the resulting column split. </p>

<p>My desired output is:</p>

<pre><code> x         v1                       v2
 Smith     murder, first degree-G   manslaughter-NG
 Jones     assault-NG               larceny, second degree-G
</code></pre>

<p>Any suggestions welcome.</p>