[R] Formatting cgroup and factor level labels in Hmisc latex function

Ista Zahn istazahn at gmail.com
Tue Jan 26 15:46:19 CET 2010


Hi Stefan,
See comments in line below.

On Tue, Jan 26, 2010 at 6:21 AM, Stefan Petersson
<stefan.petersson at inizio.se> wrote:
>
> I'm trying to typeset at simple crosstable with the Hmisc latex function. And I have two problems.
>
> 1. How do I make all columns the same width?

Use cgroup.just="p{<width><unit>} For example, for column groups 2
inches wide, use cgroup.just="p{2in}"

The Latex function seems very unwilling to break the 'cgroup' labels
and the factor level labels. Please have look at this screenshot that
shows my problem:

The latex() function will do whatever you tell it to...

>
>  >> http://hem.passagen.se/stpe9096/table.png
>
> So, how can I make sure that the cgroup labels and the factor level labels are sufficiently line breaked and/or hyphenated to make the columns evenly spaced?
>
> 2. Is there something like a 'widetable' package that can break a wide table into several tables with repeated 'rgroup' labels? As You can see in the screenshot, the table runs way off the page. And I know that there is a 'longtable' package that can do exactly this, but for tables with long rgroup lists.

I would stick with long table. Use R to re-organize you data so that
it is long instead of wide, and use longtable.

HTH,
Ista

>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org



More information about the R-help mailing list