[R] xtable()

Corey Moffet cmoffet at nwrc.ars.usda.gov
Fri Sep 27 16:19:22 CEST 2002


Try the following:

library(xtable)
dat <- data.frame(a = c(1,2,3,4,5,6), b = c(2,4,6,8,10,12))
xtable(dat, digits = c(0,5,5))

You want to have a columns+1 vector of didgets since xtable will have
three columns.

At 11:55 PM 9/27/2002 +1200, Ko-Kang Kevin Wang wrote:
>Hi,
>
>Does anyone know how to manually configure the number of digits printed
>out from xtable()?
>
>For example, I'm exporting a data frame through xtable() into a LaTeX
>table, I only have two columns in the data frame so by default I only get
>two decimal places.  But I'd like at least 5 decimal places.
>
>I had a look at ?xtable() but can't seem to find an example.
>
>
>Cheers,
>
>Kevin
>
>---------------------------------------------------------------------------
---
>Ko-Kang Kevin Wang
>Postgraduate PGDipSci Student
>Department of Statistics
>University of Auckland
>New Zealand
>Homepage: http://www.stat.auckland.ac.nz/~kwan022
>
>
>-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
.-.-
>r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
>Send "info", "help", or "[un]subscribe"
>(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
>_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
._._
>
With best wishes and kind regards I am

Sincerely,

Corey A. Moffet
Support Scientist

University of Idaho
Northwest Watershed Research Center
800 Park Blvd, Plaza IV, Suite 105
Boise, ID 83712-7716
(208) 422-0718
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list