title: Using gsub to replace \ to create an URL string
body: <p>I am using gsub to replace \, but I receive an error. I have already tried with     </p>
  
  <p>First idea (Wrong!)</p>
  
  <pre><code>root &lt;- "http://maps.google.com/maps/api/geocode/json\""
  u &lt;- gsub("\", "", u)
  </code></pre>
  
  <p>Second idea (Wrong!)</p>
  
  <pre><code>root &lt;- "http://maps.google.com/maps/api/geocode/json\""
  u &lt;- gsub("[\]", "", u)
  </code></pre>
  
  <p>Any other idea?</p>
  
  <p>I am using the root variable for this:</p>
  
  <pre><code> parameters &lt;- "&amp;key=my-key"
   root &lt;- "http://maps.google.com/maps/api/geocode/json\""
   apiRequests &lt;- paste(root, "?address=", "paris, france", 
   "\"",parameters,sep = "")
  
   conn &lt;- httr::GET(URLencode(apiRequests))
   apiResponse &lt;- jsonlite::fromJSON(httr::content(conn, "text"))
  </code></pre>