[R] Adding summary title to table

Patrick Connolly p_connolly at slingshot.co.nz
Tue Sep 4 12:25:27 CEST 2012


On Mon, 03-Sep-2012 at 03:25PM -0700, David Arnold wrote:

|> All,
|> 
|> I have:
|> 
|> x <- matrix(c(22,3,6,69,9,4,7,81,23,4,22,50),nrow=3,byrow=TRUE)
|> rownames(x) <- c("Cold or flu","Headache","Backache");
|> colnames(x) <- c("Went to doctor","No response","Did
|> nothing","Self-medicated")
|> x <- t(x)
|> print(x)
|> 
|> 1. I'd like to add the title "Nutritional Status" above the column names
|> when displayed with print(x).
|> 
|> 2. I'd like to add the title "Academic Performance" to the left of the row
|> names when displayed with print(x).
|> 
|> Any thoughts?

You'll get fairly close to what you want using print.char.matrix in
the Hmisc package.  

HTH


-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___    Patrick Connolly   
 {~._.~}                   Great minds discuss ideas    
 _( Y )_  	         Average minds discuss events 
(:_~*~_:)                  Small minds discuss people  
 (_)-(_)  	                      ..... Eleanor Roosevelt
	  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.




More information about the R-help mailing list