[R] Matrix/Table col headings R 2.0.0

Peter Dalgaard p.dalgaard at biostat.ku.dk
Thu Oct 21 16:08:34 CEST 2004


Uwe Ligges <ligges at statistik.uni-dortmund.de> writes:

> Robert W. Baer, Ph.D. wrote:

> > Somehow PD got right justified columns with this dataset.  Is there
> > a new way of doing things in version 2.0.0, my ignorance, a bug?  I
> > tried making the columns factors first, but in my hands this did not
> > appear to help either.  Thanks for any insight.
> 
> [Since this question seems to be unanswered:]

[It wasn't...]
 
> This is a question related to Peter Dalgaard's book, so why don't you
> ask the author rather than the whole world?

And make me responsible for tracking all post-publication changes in
R? (Now, what I should have had was regression tests in the ISwR
package failing when script output changed, but, well, "The road to
hell, etc...")
 
> Why does the justification matter here? I'm much too lazy to look for
> changes in R related to your question - but probably you have done
> yourself before asking the question...???

This particular change is very hard to find in NEWS, and even in the
SVN logs. It's a side effect of using format() inside print.table,
conspiring with R's default for string printing. This results in
getting right-justified strings (left-padded with spaces) printed
left-justified so that the names line up with the leading whitespace.
Try

  print(as.table(matrix(c(1,2,1,1e4),2)))


> And why don't you cite the example you are referring to (e.g. by a
> page number!!!) exactly? I'm also too lazy to read Peter's book once
> more just in order to find the example you are talking about!

It actually was a paraphrased example, as those who can grep the TeX
sources found out...

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list