title: How to do printf in r?
body: <p>I'm looking for how to do printf in r, ie I want to type:</p>
  
  <pre><code>printf("hello %d\n", 56 )
  </code></pre>
  
  <p>and get the same output as typing:</p>
  
  <pre><code>print(sprintf("hello %d\n", 56 )
  </code></pre>
  
  <p>I've read the following links:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/4071586/printing-newlines-with-print-in-r">Printing newlines with print() in R</a></li>
  <li><a href="https://stackoverflow.com/questions/3102643/whats-a-prettier-way-to-print-info-with-r">what&#39;s a prettier way to print info with R?</a></li>
  </ul>
  
  <p>... so I'm aware I could use <code>cat("hello", 56)</code> , and that's probably what I will do, but just wondering if there is some shortcut way of writing <code>print(sprintf(...))</code>?</p>
  
  <p>Sorry if this question is a duplicate (I dont know).  It's awfully hard to search for 'printf r', since it returns results for php, c, ...</p>