[R] exporting a table to latex

Rainer M Krug RKrug at sun.ac.za
Wed Dec 13 18:01:06 CET 2006


Rau, Roland wrote:
> Hi, 
> 
>> -----Original Message-----
>> From: r-help-bounces at stat.math.ethz.ch 
>> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Rainer M Krug
>> Sent: Wednesday, December 13, 2006 8:47 AM
>> To: r-help at stat.math.ethz.ch
>> Subject: [R] exporting a table to latex
> 
>> Is there another way of formating the values to three decimal digits?
>>
>> Or another way of exporting them to LaTeX?
>>
> I hope I did not oversee any emails concerning your question. Typically,

No, you didn't.

> I use the xtable-package. Please let me know if the following code is
> not doing what you hope for.

It's perfect. Doing exactly what I wanted it to do - Thanks a lot

Raienr
> 
> Best,
> Roland
> 
> 
> mydata <- data.frame(Category=LETTERS[1:10], Percentage=runif(10))
> 
> library(xtable)
> 
> xtable(mydata, digits=c(0,0,3)) ### LaTeX format => default
> #### you can even create an HTML table
> print(xtable(mydata, digits=c(0,0,5)), type="HTML")
> 
> 
> ----------
> This mail has been sent through the MPI for Demographic Research.  Should you receive a mail that is apparently from a MPI user without this text displayed, then the address has most likely been faked. If you are uncertain about the validity of this message, please check the mail header or ask your system administrator for assistance.
> 


-- 
Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation
Biology (UCT)

Department of Conservation Ecology and Entomology
University of Stellenbosch
Matieland 7602
South Africa

Tel:		+27 - (0)72 808 2975 (w)
Fax:		+27 - (0)86 516 2782
Fax:		+27 - (0)21 808 3304 (w)
Cell:		+27 - (0)83 9479 042

email:	RKrug at sun.ac.za
       	Rainer at krugs.de



More information about the R-help mailing list