[R] Frequency tables.

David Winsemius dwinsemius at comcast.net
Sat Dec 12 05:29:50 CET 2009


On Dec 11, 2009, at 10:48 PM, Kim Jung Hwa wrote:

> Thank you David and Ista for your suggestions. I got the latex part.
>
> But, this may be stupid, I got the html code using following  
> command, how
> can I make use of it? Thanks anyways.
>

On my computer just copying that to a text editor and opening with  
OpenOffice.org gets me a table object. I could alternatively saved it  
directly to disk without the copy paste oepration. You have not  
indicated what software you are using, so I guess we would have a  
tough time being any more specific about what _you_ can do with it.  
The odfWeave package and its Sweave counterpart are designed to create  
publication-worthy output.

-- 
David

> temp<-xtable(summary(Orange))
> print(temp, type="html")
>
> <!-- html table generated in R 2.9.2 by xtable 1.5-6 package -->
> <!-- Fri Dec 11 22:46:35 2009 -->
> <TABLE border=1>
> <TR> <TH>  </TH> <TH> Tree </TH> <TH>      age </TH> <TH>  
> circumference
> </TH>  </TR>
>  <TR> <TD align="right"> 1 </TD> <TD> 3:7   </TD> <TD> Min.   : 118.0
> </TD> <TD> Min.   : 30.0   </TD> </TR>
>  <TR> <TD align="right"> 2 </TD> <TD> 1:7   </TD> <TD> 1st Qu.: 484.0
> </TD> <TD> 1st Qu.: 65.5   </TD> </TR>
>  <TR> <TD align="right"> 3 </TD> <TD> 5:7   </TD> <TD> Median :1004.0
> </TD> <TD> Median :115.0   </TD> </TR>
>  <TR> <TD align="right"> 4 </TD> <TD> 2:7   </TD> <TD> Mean   : 922.1
> </TD> <TD> Mean   :115.9   </TD> </TR>
>  <TR> <TD align="right"> 5 </TD> <TD> 4:7   </TD> <TD> 3rd Qu.:1372.0
> </TD> <TD> 3rd Qu.:161.5   </TD> </TR>
>  <TR> <TD align="right"> 6 </TD> <TD>  </TD> <TD> Max.   :1582.0   </ 
> TD>
> <TD> Max.   :214.0   </TD> </TR>
>   </TABLE>
>
>
>
>
> On Fri, Dec 11, 2009 at 9:43 PM, Ista Zahn <istazahn at gmail.com> wrote:
>
>> There are a variety of packages that help format output using either
>> LaTeX or html. I've grown to prefer the latex() function in the Hmisc
>> packages, but you might also be interested in xtable (can output
>> either to LaTeX or html), R2html, or prettyR.
>>
>> -Ista
>>
>> On Fri, Dec 11, 2009 at 6:55 PM, Kim Jung Hwa <kimhwamaillist at gmail.com 
>> >
>> wrote:
>>> Hi All,
>>>
>>> I'm a SAS user but I'm very much interested in learning R.
>>>
>>> I use ODS system in SAS to make nice frequency tables. Is it  
>>> possible to
>>> export the output of table() [in TABULAR FORM]? So, that I can use  
>>> those
>>> directly for publications? Thank you.
>>>
>>> # R Code:
>>> library(datasets)
>>> Orange
>>> summary(Orange) # outputing this, not as it is, but in table for.  
>>> is it
>>> possible?
>>>
>>> ~Kim
>>>
>>>       [[alternative HTML version deleted]]
>>>
>>> ______________________________________________
>>> 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<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
>>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list