title: Replace character on string with nothing in R
body: <p>I have a vector of strings and I'd like to remove the 5th character of each element of the vector. I found <a href="https://stackoverflow.com/questions/13570312/replace-substring-with-nothing">this answer</a>, but it's not very helpful to me.</p>
  
  <p>At first, I thought that </p>
  
  <pre><code>substr(myvec, 5,5) &lt;- "" 
  </code></pre>
  
  <p>would do the trick. But it happened that this code doesn't work.</p>
  
  <p>A workaround to do what I intend to do is just:</p>
  
  <pre><code>paste(substr(myvec, 1,4), substr(myvec, 6,nchar(myvec)), sep="")
  </code></pre>
  
  <p>But is it really impossible to use substr directly, as I intended to do?
  Below is a reproducible example.</p>
  
  <pre><code>myvec &lt;- c("19601Urbana", "19601Rural", "19701Urbana", "19701Rural", "19801Urbana", "19801Rural", "19912Urbana", "19912Rural", "20002Urbana", "20002Rural", "20102Urbana", "20102Rural")
  </code></pre>
  
  <p>Any ideas? I guess I could try some regex, but It seems that it will be a little bit hard to use it. Also, it seems overkill.</p>
  
  <p>update: Since some people say it works on their computer, my session info:
  R version 3.0.0 (2013-04-03)
  Platform: x86_64-w64-mingw32/x64 (64-bit)
  I'm using windows 8. </p>