title: strsplit returning nested list with backslashes and quotes added \"
body: <p>I'm using R to split a messy string of gene names and as a first step am simply attempting to break the string into a list by spaces between characters using strsplit and regex but have been coming across this weird bug:</p>
  <pre><code>string &lt;- ' &quot; &quot;KPNA2&quot;              &quot;UBE2C&quot;              &quot;CENPF&quot;             ##   [4] &quot;HMGB2&quot;'
  
  ccGenes &lt;- strsplit(string, split = '\\s+')[[1]]
  </code></pre>
  <p>returns a length 1 nested list containing an object of type &quot;character [8]&quot; (not sure what type of object this indicates) that places a backslash in front of double quotes (&quot; -&gt; \&quot;) looks like this when printed:</p>
  <pre><code>&quot;&quot;          &quot;\&quot;&quot;        &quot;\&quot;KPNA2\&quot;&quot; &quot;\&quot;UBE2C\&quot;&quot; &quot;\&quot;CENPF\&quot;&quot; &quot;##&quot;        &quot;[4]&quot;       &quot;\&quot;HMGB2\&quot;&quot;
  </code></pre>
  <p>what I want is a list that looks like this:</p>
  <pre><code>&quot; &quot;KPNA2&quot; &quot;UBE2C&quot; &quot;KPNA2&quot; &quot;UBE2C&quot; etc... 
  </code></pre>
  <p>After I will clean up the quotes and non gene items. I realize this is probably not the most efficient way to go about cleaning up this string, I'm still relatively new to programming and am more curious why the strsplit line I'm using is returning such weird output.</p>
  <p>Thanks!</p>