title: replace a specific part of a string with the value of a variable with R
body: <p>Hi I have an URL string but I need to replace a specific portion of the string to a variable</p>
  <p>this is the code I have</p>
  <pre><code>todays_date &lt;- as.character(Sys.Date())
  
  
     URL &lt;- &quot;https://api.performancehorizon.com/reporting/export/export/click.csv?start_date=2021-11-23+00%3A00%3A00&amp;end_date=2021-11-24+00%3A00%3A00&amp;campaign_id=1011l3888&amp;convert_currency=USD&amp;ref_conversion_metric_id%5B%5D=2&quot;
  </code></pre>
  <p>I would need to change the date where it says <code>end_date</code> at this moment is 2021-11-23 to whatever value the variable todays_date is, in this case is the sysdate (11/24/2021) so the final string should be</p>
  <pre><code>&quot;https://api.performancehorizon.com/reporting/export/export/click.csv?start_date=2021-11-23+00%3A00%3A00&amp;end_date=2021-11-24+00%3A00%3A00&amp;campaign_id=1011l3888&amp;convert_currency=USD&amp;ref_conversion_metric_id%5B%5D=2&quot;
  </code></pre>
  <p>I imagine there should be like a wild card where the variable would be in.</p>
  <p>Thanks</p>