Is there a string formatting operator in R similar to Python's %? : <p>I have a url that I need to send a request to using date variables. The https address takes the date variables. I'd like to assign the dates to the address string using something like the formatting operator % in Python. Does R have a similar operator or do I need to rely on paste()?</p>

<pre><code># Example variables
year = "2008"
mnth = "1"
day = "31"
</code></pre>

<p>This is what I would do in Python 2.7:</p>

<pre><code>url = "https:.../KBOS/%s/%s/%s/DailyHistory.html" % (year, mnth, day)
</code></pre>

<p>Or using .format() in 3.+.</p>

<p>The only I'd know to do in R seems verbose and relies on paste:</p>

<pre><code>url_start = "https:.../KBOS/"
url_end = "/DailyHistory.html"
paste(url_start, year, "/", mnth, "/", day, url_end) 
</code></pre>

<p>Is there a better way of doing this?</p>
