[R] Aligning ragged text columns

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


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



More information about the R-help mailing list