title: Is there an R equivalent of python's string `format` function?
body: <p>In python there's a nice function (str <code>.format</code>) that can really easily replace variables (encoded like <code>{variable}</code>) in a string with values stored in a dict (with values named by variable name). Like so:</p>
  
  <pre><code>vars=dict(animal="shark", verb="ate", noun="fish")
  string="Sammy the {animal} {verb} a {noun}."
  print(string.format(**vars)) 
  </code></pre>
  
  <blockquote>
    <p>Sammy the shark ate a fish.</p>
  </blockquote>
  
  <p>What is the simplest solution in <code>R</code>? Is there a built-in equivalent 2-argument function that takes a string with variables encoded <strong>in the same 
  way</strong> and replaces them with named values from a named <code>list</code>?</p>
  
  <p>If there is no built-in function in R, is there one in a published package?</p>
  
  <p>If there is none in a published package, what would you use to write one?</p>
  
  <p>The rules: the string is given to you with variables encoded like "{variable}". The variables must be encoded as a <code>list</code>. I will answer with my custom-made version, but will accept an answer that does it better than I did.</p>