[R] Aligning ragged text columns

hadley wickham h.wickham at gmail.com
Wed Jul 19 11:29:03 CEST 2006


> heading1 <- "Heading1"
> heading2 <- "Heading2"
>
> a <- matrix(c(
>         "Heading 1",  paste("This is some info\nabout", heading1, sep=""),
>         "Heading 2",  paste("This is some info\nabout", heading2, sep=""),
> ), byrow=T, nrow=2)

I wasn't so concerned about the redundancy in my example, but how it looks - eg.

> somefunction(h)
Heading 1  This is some info
          about heading 1
Heading 2  This is some info
          about heading 2


Hadley



More information about the R-help mailing list