Ista Zahn
2008-Dec-01 12:24 UTC
[R] Question about the rgroup option in Hmisc latex function
Is there a way to use the rgroup option without creating horizontal rules separating the groups? For example, say I have the following matrix containing sample sizes, means, and standard deviations, for three groups of male and female participants:> descriptivesn Mean SD Male "2" "0.703" "-0.809" Female "3" "0.533" "-0.376" Male "2" "2.097" "-0.534" Female "3" "0.843" " 0.966" Male "2" "0.350" " 0.149" Female "3" "0.685" " 0.600" I try typesetting the table with> latex(descriptives, title="", file="", label="tab:descript", ctable=TRUE, caption="Means and standard deviations by condition and sex", colheads=c("Condition", "n", "Mean", "SD"), rgroup=c("One", "Two", "Three"))which results in \ctable[ caption={Means and standard deviations by condition and sex}, label=tab:descript, pos=!tbp, ]{llll} {} {\FL\multicolumn{1}{l}{Condition}& \multicolumn{1}{c}{n}& \multicolumn{1}{c}{Mean}& \multicolumn{1}{c}{SD} \ML {\bfseries One}&&&\NN ~~Male&2&0.703&-0.809\NN ~~Female&3&0.533&-0.376 \ML {\bfseries Two}&&&\NN ~~Male&2&2.097&-0.534\NN ~~Female&3&0.843& 0.966 \ML {\bfseries Three}&&&\NN ~~Male&2&0.350& 0.149\NN ~~Female&3&0.685& 0.600 \LL } but I want \ctable[ caption={Means and standard deviations by condition and sex}, label=tab:descript, pos=!tbp, ]{llll} {} {\FL\multicolumn{1}{l}{Condition}& \multicolumn{1}{c}{n}& \multicolumn{1}{c}{Mean}& \multicolumn{1}{c}{SD} \ML {\bfseries One}&&&\NN ~~Male&2&0.703&-0.809\NN ~~Female&3&0.533&-0.376\NN {\bfseries Two}&&&\NN ~~Male&2&2.097&-0.534\NN ~~Female&3&0.843& 0.966\NN {\bfseries Three}&&&\NN ~~Male&2&0.350& 0.149\NN ~~Female&3&0.685& 0.600 \LL } i.e, I want the horizontal rules separating the row groups omitted. Can this be done? Thanks, Ista
Jon Loehrke
2008-Dec-30 13:59 UTC
[R] Question about the rgroup option in Hmisc latex function
Hi Ista, I think you looking for: n.rgroup? See help(latex). Also, try posting your example in a copy and past form, like: descriptives<-data.frame(n=..., mean=...) etc. The easier it is for others to reproduce your initial results the quicker the problem will be solved. HTH, Jon Loehrke Graduate Research Assistant Department of Fisheries Oceanography School for Marine Science and Technology University of Massachusetts 200 Mill Road, Suite 325 Fairhaven, MA 02719