title: separating a column into multiple based on character position
body: <p>I have something similar to this
  <a href="https://i.stack.imgur.com/sYRHu.png" rel="nofollow noreferrer">set of data</a></p>
  
  <pre><code>891 Rehab  2a        SQ002  1                                                                                               
  892 Rehab  2a        SQ002  1                                                                                               
  893 Rehab  2a        SQ002  1                                                                                               
  894 Rehab  2a        SQ002  2                                                                                               
  895 Rehab  2a        SQ002  2                                                                                               
  896 Rehab  2a        SQ002  1                                                                                               
  897 Rehab  2a        SQ002  2                                                                                               
  898 Rehab  2a        SQ002  2                                                                                               
  899 Rehab  2a        SQ002  1                                                                                               
  900 Rehab  2a        SQ002  1 
  </code></pre>
  
  <p>and I am not sure how to separate the column (questionn) containing 2a into two separate columns one with "a" and one with "2". I have tried before with this</p>
  
  <pre><code>testra2&lt;- testra1 %&gt;% 
    separate(questionn,  
              into = c("num", "text"),
              sep= "(?=[0-9])(?&lt;=[A-Za-z])")
  </code></pre>
  
  <p>but it basically just creates a blank column and I get this warning message:</p>
  
  <blockquote>
    <p>"Warning message: Expected 2 pieces. Missing pieces filled with <code>NA</code>
    in 2720 rows [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
    17, 18, 19, 20, ...].</p>
  </blockquote>
  
  <p>I would be grateful for any help, thank you very much:)</p>