[R] Aligning ragged text columns

From: hadley wickham <h.wickham_at_gmail.com>
Date: Wed 19 Jul 2006 - 19:03:15 EST


Can anyone please suggest how I can print:

a <- matrix(c(

"Heading 1", "This is some info\nabout heading 1",
"Heading 2", "This is some info\nabout heading 2",
), byrow=T, nrow=2)

to look like:

Heading 1 This is some info

           about heading 1
Heading 2 This is some info

           about heading 2

(if you're not using a fixed width font, I want the text in the second column to line up)

I've looked at encodeString and format, but neither seems to quite be the right tool

Thanks!

Hadley



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed Jul 19 22:31:40 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 20 Jul 2006 - 00:17:57 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.