Let’s say I have 3 vectors in R:

```
x <- c("xskdlfl", "  y", "lkjsf")
y <- c(22.5, 6, 7.0)
z <- c("slk","llkjdf", "xx")

```

I would like to produce a formatted tabular output with the right-most character aligned like so in all columns except the first:

```
xskdlfl        y     lkjsf
22.5         5.6       7.0
slk       llkjdf        xx

```

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.