[R] comma as decimal separator in xtable

Jakson A. Aquino jaksonaquino at gmail.com
Wed Sep 16 19:18:48 CEST 2009


On Wed, Sep 16, 2009 at 03:29:44PM +0200, David Hajage wrote:
> But, it seems that dcolumn can change the decimal separator too (see the
> table on the first page of the pdf document).
> 
> For example:
> 
> \documentclass{article}
> 
> \usepackage{dcolumn}
> 
> \newcolumntype{d}[1]{D{.}{,}{#1}}
> 
> \begin{document}
> 
> <<results=tex>>=
> x <- matrix(rnorm(4), 2, 2)
> library(xtable)
> xtable(x, align = c("l", "|", "d{2}", "|", "c", "|"))
> @
> 
> \end{document}

It works. Thanks!

> 
> 2009/9/16 Jakson A. Aquino <jaksonaquino at gmail.com>
> 
> > On Wed, Sep 16, 2009 at 01:59:29PM +0200, David Hajage wrote:
> > > Perhaps with the dcolumn package ?
> > > http://newton.ex.ac.uk/research/qsystems/people/latham/LaTeX/dcolumn.pdf




More information about the R-help mailing list