[R] Hmisc latex format.df by row formatting?

Dieter Menne dieter.menne at menne-biomed.de
Thu Dec 8 10:59:55 CET 2005


Dieter Menne <dieter.menne <at> menne-biomed.de> writes:

> 
> Using Hmisc, I get the following output from format.df (which will feed to
> latex)
> 
>        Min     Q1      Med   Mean      Q3      Max
> Age    " 30" " 32.5" " 36" " 37.50" " 41.00" " 49"
> Height "174" "175.0" "178" "179.00" "181.00" "188"
> Weight " 68" " 74.0" " 78" " 76.67" " 79.75" " 83"
> 
> Automatic decimal points adjustments does not exactly do what I want in this
> case. It would be nice to have the same number of decimals row-wise.


Try something like:

     xt = t(format.df(t(as.matrix(xt))))

Dieter




More information about the R-help mailing list