I have been looking at some 'table' examples in Peter Dalgaard's ISwR book, and I am
confused by how to get right justification of my table headings when I use the
tables() command. Compare the following:
# Produces right justfified column names
caff.marital=matrix(c(652,1537,598,242,36,46,38,21,218,327,106,67),nrow=3,byrow=T)
colnames(caff.marital)=c("0","1-150","151-300",">300")
rownames(caff.marital)=c("Married","Prev.married","Single")
caff.marital
class(caff.marital)
#Produces Left justified column names
library(ISwR)
data(juul)
attach(juul)
sex.tan=table(sex,tanner)
colnames(sex.tan)=c("I","II","IIII","IV","V")
rownames(sex.tan)=c("M","F")
sex.tan
class(sex.tan)
# Finally, look at (left justified)
as.table(caff.marital)
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.
> version
_
platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
status
major 2
minor 0.0
year 2004
month 10
day 04
language R
___________________________
Robert W. Baer, Ph.D.
Department of Physiology
A. T. Still University of Health Science
800 W. Jefferson St.
Kirksville, MO 63501-1497 USA
[[alternative HTML version deleted]]
______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html