[R] exporting a table to latex

Rau, Roland Rau at demogr.mpg.de
Wed Dec 13 17:12:38 CET 2006


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,
I use the xtable-package. Please let me know if the following code is
not doing what you hope for.

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 Rese...{{dropped}}



More information about the R-help mailing list