title: How to separate a string of digits and letters of various length into different columns in R?
body: <p>I have a column called 'WFBS' that has over a million rows of strings of different lengths that look like this:  </p>
  
  <pre><code>WFBS &lt;- c("M010203", "S01020304", "N104509")
  
  </code></pre>
  
  <p>and I need an output that looks like this: </p>
  
  <pre><code>WFBS1 &lt;- c("M01", "S01", "N10")
  WFBS2 &lt;- c("02", "02", "45")
  WFBS3 &lt;- c("03", "03", "09")
  WFBS4 &lt;- c(NA, "04", NA)
  
  </code></pre>
  
  <p>So I need to separate each string in: 
  first column: 3 characters (ie the letter followed by 2 digits)
  rest of the columns: 2 characters per column until I have no characters left</p>
  
  <p>I tried using the function strsplit, but it says that my variables are not characters, so then I created a vector x as follows:</p>
  
  <pre><code>x &lt;- as.character(WFBS)
  </code></pre>
  
  <p>but then I don't know how to separate the string into columns with the function strsplit.</p>