Skip to content

Left justification af dimnames in tables.

2 messages · Ladelund, Steen, Peter Dalgaard

#
Hi helpeRs.

When I do two-ways tables dimnames in columns are almost left-adjusted:
  <- factor(rbinom(30,1,.3),labels=c("first","second"))
b
a        first second
  first  21     0    
  second  0     9 

If I do a oneway table however, dimnames are right-adjusted:

table(a)
a
 first second 
    21      9 

Actually I must admit I dont know if its the dimnames or/and the cell counts
that are adjusted ;-)

Is there a way that I can get left-adjusted dimnames i oneway tables.

Thans in advance

Steen


Steen Ladelund, statistician
+4543233275 stelad01FUNNYAglostruphospDOTkbhamt.dk
Research Center for Prevention and Health
Glostrup University Hospital, Denmark
www.fcfs.kbhamt.dk
#
"Ladelund, Steen" <STELAD01 at glostruphosp.kbhamt.dk> writes:
This was actually an inadvertent change in R 1.7.0. It is fixed in the
development version of R but it was decided to keep the fix out of the
patch versions because it would change a lot of printed output (and
some people run automatic checks for that). For a twoway table,
there's a simple workaround:
b
a        first second
  first     21      0
  second     0      9

Unfortunately, it doesn't seem to work for multiway tables....