[R] how to get R to print only one column per line when outputting a matrix?

Godmar Back godmar at gmail.com
Tue Jul 7 16:06:39 CEST 2009


Hi,

I'm trying to make it easier for my survey evaluators to read the
results of my survey analysis. To that end, I'd like to suppress R's
habit of filling every line up to width columns.  How do I do that?

For instance, using 'print()', R outputs something like:

     [,1]                     [,2]
var2 "someshortname" "someothershortname"
r    0.3341755                0.3275274
N    136                      136
     [,3]
var2 "somereallyreallyreallyreallyreallylongname"
r    0.323306
N    136
     [,4]
var2 "someotherreallyreallyreallyreallyreallylongname"
r    0.3121291
N    101
----

How can I get it to place every column on a new line to avoid
confusing the reader?

I read the help for print, print.default, format, cat, and
options(width) and wasn't able to find an answer.

Thanks!

 - Godmar




More information about the R-help mailing list