Replace space with %20 in r : <p>I have following string: </p>

<pre><code>url &lt;- https://www.google.mu/webhp?sourceid=chrome-instant&amp;ion=1&amp;espv=2&amp;ie=UTF-8#q=green carot
</code></pre>

<p>I want to replace the space between green and carot with %20</p>

<pre><code>&gt;url
https://www.google.mu/webhp?sourceid=chrome-instant&amp;ion=1&amp;espv=2&amp;ie=UTF-8#q=green%20carot
</code></pre>
