Extract all words from a string and create a column with the result
<p>I have a data frame (data3) with a Column named "Collector". In this column i have alpha numeric characters. For example: "Ruiz and Galvis 650". I need to extract the alpha characters and the numeric characters separately, and create two new columns, one with the numbers of that string (ColID) and another one with all the words (Col): </p>

<p>INPUT:</p>

<pre><code>Collector                       Times     Sample
Ruiz and Galvis 650             9         SP.1              
Smith et al 469                 8         SP.1
</code></pre>

<p>EXPECTED OUTPUT        </p>

<pre><code>Collector                       Times     Sample     ColID    Col
Ruiz and Galvis 650             9         SP.1        650     Ruiz and Galvis
Smith et al 469                 8         SP.1        469     Smith et al
</code></pre>

<p>I have tried the following but when I try to save the file I get an error (Error in .External2(C_writetable, x, file, nrow(x), p, rnames, sep, eol,  : 
  unimplemented type 'list' in 'EncodeElement'):</p>

<pre><code>regexp &lt;- "[[:digit:]]+"
data3$colID&lt;- NA
data3$colID &lt;- str_extract (data3$Collector, regexp)

data3$Col&lt;- NA
regexp &lt;-"[[:alpha:]]+"
data3$Col &lt;- (str_extract_all (data3$Collector, regexp))
write.table(data3, file = paste("borrar2",".csv", sep=""), quote=T, sep = ",", row.names = F)
</code></pre>