title: convert scientific notation into a character
body: <p>I have a data frame that should be a character with a pattern of <em>num, char, num, num</em> (ex: 1C72) but any observation with an E was written in scientific notation in the original csv. (ex: 8.00E+04)</p>
  
  <p>Here's what I tried:</p>
  
  <pre><code>library(data.table)
  library(dplyr)
  example = as.data.frame(c("1B73","1C24","2.00E+08", "4.00E+04", "SBV123"))
  colnames(example)[1] &lt;- "x"
  example$x = as.character(example$x)
  
  #isolate problematic column  
  setDT(example)[nchar(example$x) == 8, x8:=x]
  
  #create new columns for data we want  
  example$a &lt;- substr(example$x8,1,1)
  example$b &lt;- substr(example$x8,5,5)
  example$c &lt;- substr(example$x8,7,8)
  example$good &lt;- paste(example$a,example$b,example$c,sep = "")
  example$good[example$good == "NANANA"] &lt;- NA
  
  #combine good data:  
  example = example %&gt;% mutate(g2 = coalesce(good, x))
  </code></pre>
  
  <p>This solution works but is quite lengthy and creates a lot of columns. Is there any way to do this without creating a bunch of columns?</p>
  
  <p>Desired Output:</p>
  
  <pre><code>|g2    |
  |1B73  |
  |1C24  |
  |2E08  |
  |4E04  |
  |SBV123|
  </code></pre>