[R] Nicely formatted tables

steve fisk at bowdoin.edu
Thu Dec 14 22:37:51 CET 2006


If I use latex(summary(X)) where X is a data frame with four
variables I get something like

    Rainfall       Education         Popden        Nonwhite    
 Min.   :10.00   Min.   : 9.00   Min.   :1441   Min.   : 0.80  
 1st Qu.:32.75   1st Qu.:10.40   1st Qu.:3104   1st Qu.: 4.95  
 Median :38.00   Median :11.05   Median :3567   Median :10.40  
 Mean   :37.37   Mean   :10.97   Mean   :3866   Mean   :11.87  
 3rd Qu.:43.25   3rd Qu.:11.50   3rd Qu.:4520   3rd Qu.:15.65  
 Max.   :60.00   Max.   :12.30   Max.   :9699   Max.   :38.50  


where the row headings are repeated four times times.
Is there an easy way to get a nicely formatted table,
something like

        Rainfall     Education   Popden    Nonwhite    
 Min.     10.00       9.00        1441        0.80  
 1st Qu.  32.75      10.40        3104        4.95  
 Median   38.00      11.05        3567       10.40  
 Mean     37.37      10.97        3866       11.87  
 3rd Qu.  43.25      11.50        4520       15.65  
 Max.     60.00      12.30        9699       38.50  


Steve



More information about the R-help mailing list