title: How do I align printed columns of vectors with sprintf (R)
body: <p>Let’s say I have 3 vectors in R:</p>
  
  <pre><code>x &lt;- c("xskdlfl", "  y", "lkjsf")
  y &lt;- c(22.5, 6, 7.0)
  z &lt;- c("slk","llkjdf", "xx")
  </code></pre>
  
  <p>I would like to produce a formatted tabular output with the right-most character aligned like so in all columns except the first:</p>
  
  <pre><code>xskdlfl        y     lkjsf
  22.5         5.6       7.0
  slk       llkjdf        xx
  </code></pre>
  
  <p>I cannot figure out how to do this with sprintf without a lot of messy programming in R. Is there a straightforward way to do this in R using sprintf? Using ‘format?’ I’d appreciate a link to a good sprintf tutorial. Thanks in advance.</p>