[R] xtable with dupplicate rownames

Anirudh V. S. Ruhil ruhil at ohio.edu
Sat Mar 10 19:11:15 CET 2007


I have  a table (tab5; see below) with the first block showing the counts 
in a cross-tabulation, and the lower block reflecting the proportions of 
interest.

> tab5
             None Low Level Moderate Intense Very Intense Total
None         0.00      3.00     0.00    0.00         1.00     4
Low Level    1.00      2.00     0.00    0.00         0.00     3
Moderate     2.00      3.00     2.00    0.00         0.00     7
Intense      3.00      1.00     1.00    1.00         0.00     6
Very Intense 0.00      1.00     2.00    0.00         0.00     3
Total        6.00     10.00     5.00    1.00         1.00    23
None         0.00      0.75     0.00    0.00         0.25     1
Low Level    0.33      0.67     0.00    0.00         0.00     1
Moderate     0.29      0.43     0.29    0.00         0.00     1
Intense      0.50      0.17     0.17    0.17         0.00     1
Very Intense 0.00      0.33     0.67    0.00         0.00     1

When I execute
	foo5 <- xtable(format(tab5), caption = "XYZ")

I get the following error message
	Warning message:
	some row.names duplicated: 7,8,9,10,11 --> row.names NOT used in: 
	data.row.names(row.names, rowsi, i)

Is there any way to force the duplicate row-names to be retained in xtable?

Alternatively, is there a succinct way of building a cross-tabulation with 
both counts and proportions in each cell, and then using xtable?

thanks for any and all tips

Ani

Anirudh V. S. Ruhil, Ph.D.
Sr. Research Associate
Voinovich Center for Leadership and Public Affairs
Ohio University
Building 21, The Ridges
Athens, OH 45701-2979
Tel: 740.597.1949 | Fax: 740.597.3057



More information about the R-help mailing list