title: Split Column By Space
body: <pre><code>DATA &lt;- data.frame(&quot;V1&quot; = c(&quot;SCORE : 9.931 5.092&quot;,
                              &quot;SCORE : 6.00007 15.1248&quot;,
                              &quot;SCORE : 1.0002 12.987532&quot;,
                              &quot;SCORE : 3.1 3.98532&quot;))
  WANT &lt;- data.frame(&quot;VAR1&quot; = c(9.931, 6.00007, 1.0002, 3.1),
                     'VAR2' = c(5.092, 15.1248, 12.987532, 3.98532))
  </code></pre>
  <p>What I have is student test score data that was entered like shown in 'DATA' but I wish to split it so that what I have is like what is shown in the 'WANT' frame where the first number is in 'VAR1' and the second number is in 'VAR2' ignoring the spaces</p>
  <p>MY ATTEMPT:</p>
  <pre><code>DATA[, c(&quot;VAR1&quot;, &quot;VAR2&quot;) := trimws(V1, whitespace = &quot;.*:\\s+&quot;)]
  </code></pre>
  <p>PRODUCE:
  <a href="https://i.stack.imgur.com/GOK6j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GOK6j.png" alt="enter image description here" /></a></p>