title: paste() on a vector gives unwanted whitespace, how to remove it?
body: <p>I am trying to remove whitespace from objects in a vector in R. I have problems when I use the function <code>paste</code>; it gives me the objects of <code>a</code> with a <code>space</code>. </p>
  
  <pre><code>a &lt;- c(1985, 1986, 2004)
  i &lt;- 0
  while(i&lt;(length(a))) {
    i &lt;- i+1
    b &lt;- (paste("C:/Users/franc/Documents/Fran/Tesis/Sin sincronizar/Imagenes Landsat/",
        a[[i]]))
    c &lt;- paste(b,"/Invierno/band3.tif")
    (paste(a[[i]],"3")) &lt;- raster(c)
  }
  c
  </code></pre>
  
  <p>And the result of c is</p>
  
  <blockquote>
    <p>"C:/Users/franc/Documents/Fran/Tesis/Sin sincronizar/Imagenes Landsat/
    1985 /Invierno/band3.tif"</p>
  </blockquote>
  
  <p>instead of:</p>
  
  <blockquote>
    <p>"C:/Users/franc/Documents/Fran/Tesis/Sin sincronizar/Imagenes
    Landsat/1985/Invierno/band3.tif"</p>
  </blockquote>
  
  <p>(The problem is in the year 1985)</p>